<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:asptesttest.asp")
Response.Write("The file test.asp is in the folder: ")
Response.Write(f.ParentFolder)
set f=nothing
set fs=nothing
%>
輸出:
The file test.asp is in the folder: C:asptest
針對(duì) Folder 對(duì)象的實(shí)例
<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:asptest")
Response.Write("The folder test is in the folder: ")
Response.Write(fo.ParentFolder)
set fo=nothing
set fs=nothing
%>