<完整的文件對象參考
所述ParentFolder屬性用於返回文件夾對象指定的文件或文件夾的父。
句法
FileObject.ParentFolder
FolderObject.ParentFolder
例如,對於文件對象
<%
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
%>
Output:
The file test.asp is in the folder: C:\asp\test
例如,對於文件夾對象
<%
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
%>
Output:
The folder test is in the folder: C:\asp
<完整的文件對象參考