ASP Path 属性
定义和用法
Path 属性用于为指定的驱动器、文件或文件夹返回路径。
语法:
DriveObject.PathFileObject.PathFolderObject.Path
针对 Drive 对象的例子
<%dim fs,dset fs=Server.CreateObject("Scripting.FileSystemObject")set d=fs.GetDrive("e:")Response.Write("路径是 " & d.Path)set d=nothingset fs=nothing%>
输出:
路径是 E:
针对 File 对象的例子
<%dim fs,fset fs=Server.CreateObject("Scripting.FileSystemObject")set f=fs.GetFile("c:\asp\test.asp")Response.Write("路径是: " & f.Path)set f=nothingset fs=nothing%>
输出:
路径是: C:\asp\test.asp
针对 Folder 对象的例子
<%dim fs,foset fs=Server.CreateObject("Scripting.FileSystemObject")set fo=fs.GetFolder("c:\asp\test")Response.Write("路径是: " & fo.Path)set fo=nothingset fs=nothing%>
输出:
路径是: C:\asp\test