codecamp

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 对象参考手册
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

ASP 实例

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }