最新的Web开发教程
 

ASP Attributes Property


<完整文件夹对象参考

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

句法

FileObject.Attributes[=newattributes]

FolderObject.Attributes[=newattributes]

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

可以采取以下任一值或以下值的组合:

0 =正常文件
1 =只读文件
2 =隐藏文件
4 =系统文件
16 =文件夹或目录
上次备份32 =文件已经改变
1024 =链路或捷径
2048 =压缩文件

例如,对于文件对象

<%
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
%>

Output:

The attributes of the file are: 32

例如,对于文件夹对象

<%
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
%>

Output:

The attributes of the folder are: 16

<完整文件夹对象参考