ASP Drive 屬性
完整的 File 對(duì)象參考手冊(cè)
Drive 屬性用于返回指定文件或文件夾所在的驅(qū)動(dòng)器的驅(qū)動(dòng)器字母(驅(qū)動(dòng)器號(hào))。
語(yǔ)法
FileObject.Drive
FolderObject.Drive
針對(duì) File 對(duì)象的實(shí)例
<%
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:
針對(duì) Folder 對(duì)象的實(shí)例
<%
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:
完整的 File 對(duì)象參考手冊(cè)
更多建議: