最新的Web开发教程
 

ASP Path Property


<完整的文件对象参考

路径属性用于返回路径指定的驱动器,文件或文件夹。

句法

DriveObject.Path

FileObject.Path

FolderObject.Path

例如用于驱动对象

<%
dim fs,d
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
Response.Write("The path is " & d.Path)
set d=nothing
set fs=nothing
%>

Output:

The path is C:

例如,对于文件对象

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\asp\test\test.asp")
Response.Write("The path is: " & f.Path)
set f=nothing
set fs=nothing
%>

Output:

The path is: C:\asp\test\test.asp

例如,对于文件夹对象

<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\asp\test")
Response.Write("The path is: " & fo.Path)
set fo=nothing
set fs=nothing
%>

Output:

The path is: C:\asp\test

<完整的文件对象参考