ASP Attributes 属性
定义和用法
Attributes 属性用于设置或返回指定文件或文件夹的属性。
语法:
FileObject.Attributes[=newattributes]FolderObject.Attributes[=newattributes]
| 参数 | 描述 |
|---|---|
| newattributes | 可选的。规定文件或文件夹的属性值。 可采用下列值之一或者下列值的组合:
|
针对 File 对象的例子
<%dim fs,fset fs=Server.CreateObject("Scripting.FileSystemObject")set f=fs.GetFile("c:\test.txt")Response.Write("文件的属性为: ")Response.Write(f.Attributes)set f=nothingset fs=nothing%>
输出:
文件的属性为: 32
针对 Folder 对象的例子
<%dim fs,foset 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=nothingset fs=nothing%>
输出:
文件夹的属性为: 16