codecamp

ASP Attributes 属性

ASP Attributes 属性


Folder 对象参考手册 完整的 Folder 对象参考手册

Attributes 属性用于设置或返回指定文件或文件夹的属性。

语法

FileObject.Attributes[=newattributes]

FolderObject.Attributes[=newattributes]

参数 描述
newattributes 可选的。规定文件或文件夹的属性值。

可采用下列值之一或者下列值的组合:

0 = 普通文件。
1 = 只读文件。
2 = 隐藏文件。
4 = 系统文件。
16 = 文件夹或目录。
32 = 上次备份后已更改的文件。
1024 = 链接或快捷方式。
2048 = 压缩文件。

针对 File 对象的实例

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\test.txt")
Response.Write("The attributes of the file are: ")
Response.Write(f.Attributes)
set f=nothing
set fs=nothing
%>

输出:

The attributes of the file are: 32

针对 Folder 对象的实例

<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test")
Response.Write("The attributes of the folder are: ")
Response.Write(fo.Attributes)
set fo=nothing
set fs=nothing
%>

输出:

The attributes of the folder are: 16


Folder 对象参考手册 完整的 Folder 对象参考手册
温馨提示
下载编程狮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; }