最新的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

<完整文件夾對象參考