ASP ParentFolder 属性

asp parentfolder 属性

file 对象参考手册 完整的 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 对象参考手册 完整的 file 对象参考手册
相关文章