<完整的文件對象參考
該驅動器屬性用於返回指定的文件或文件夾所在的驅動器的驅動器號。
句法
FileObject.Drive
FolderObject.Drive
例如,對於文件對象
<%
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
%>
Output:
File resides on drive: c:
例如,對於文件夾對象
<%
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
%>
Output:
Folder resides on drive: c:
<完整的文件對象參考