最新的Web开发教程
 

ASP ParentFolder Property


<完整文件夹对象参考

所述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

<完整文件夹对象参考