Drive

阅读:39      收藏:0      [点我收藏+]

ASP Drive 属性


Drive 属性用于返回指定文件或文件夹所在的驱动器的驱动器字母(驱动器号)。

语法

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:
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!