ASP Drive 屬性
完整的 Folder 對象參考手冊
Drive 屬性用于返回指定文件或文件夾所在的驅(qū)動器的驅(qū)動器字母(驅(qū)動器號)。
語法
FileObject.Drive
FolderObject.Drive
針對 File 對象的實例
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\test.txt")
Response.Write("File resides on drive: ")
Response.Write(f.Drive)
set f=nothing
set fs=nothing
%>
輸出:
File resides on drive: c:
針對 Folder 對象的實例
<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test")
Response.Write("Folder resides on drive: ")
Response.Write(fo.Drive)
set fo=nothing
set fs=nothing
%>
輸出:
Folder resides on drive: c:
完整的 Folder 對象參考手冊
更多建議: