ASP ParentFolder 屬性
完整的 File 對象參考手冊
ParentFolder 屬性用于為指定文件或文件夾的父級返回 folder 對象。
語法
FileObject.ParentFolder
FolderObject.ParentFolder
針對 File 對象的實例
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\asp\test\test.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:\asp\test
針對 Folder 對象的實例
<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\asp\test")
Response.Write("The folder test is in the folder: ")
Response.Write(fo.ParentFolder)
set fo=nothing
set fs=nothing
%>
輸出:
The folder test is in the folder: C:\asp
完整的 File 對象參考手冊
更多建議: