ParentFolder

阅读:43      收藏:0      [点我收藏+]

ASP ParentFolder 属性


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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!