ASP Path ÊôÐÔ
¶¨ÒåºÍÓ÷¨
Path ÊôÐÔÓÃÓÚ·µ»ØÖ¸¶¨µÄÇý¶¯Æ÷¡¢Îļþ»òÕßÎļþµÄ·¾¶¡£
×¢ÊÍ£º¶ÔÓÚÇý¶¯Æ÷£¬Â·¾¶²»°üº¬¸ùĿ¼¡£ÀýÈ磬C Çý¶¯Æ÷µÄ·¾¶ÊÇ C:£¬¶ø²»ÊÇ C:\¡£
Óï·¨£º
DriveObject.Path FileObject.Path FolderObject.Path
ʵÀý
Õë¶Ô Drive ¶ÔÏóµÄÀý×Ó
<%
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
%>
Êä³ö£º
The path is C:
Õë¶Ô File ¶ÔÏóµÄÀý×Ó
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("d:\asp\test\test.asp")
Response.Write("The path is: " & f.Path
)
set f=nothing
set fs=nothing
%>
Êä³ö£º
The path is: D:\asp\test\test.asp
Õë¶Ô Folder ¶ÔÏóµÄÀý×Ó
<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("d:\asp\test")
Response.Write("The path is: " & fo.Path
)
set fo=nothing
set fs=nothing
%>
Êä³ö£º
The path is: D:\asp\test