当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Attributes 属性

ASP
ASP 介绍
ASP Install
ASP 语法
ASP 变量
ASP Procedures
ASP Forms
ASP Cookies
ASP Session
ASP Application
ASP #include
ASP Global.asa
ASP Send e-mail
ASP Response
ASP Request
ASP Application
ASP Session
ASP Server
ASP Error
ASP FileSystem
ASP TextStream

ASP Attributes 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 462 ::
收藏到网摘: n/a

The Attributes property is used to set or return the attribute or attributes of a specified file or folder.
ASP Attributes属性的作用是设置或返回一个指定文件或文件夹的属性值。

Syntax
语法

FileObject.Attributes[=newattributes]

FolderObject.Attributes[=newattributes]


Parameter参数 Description描述
newattributes Optional. Specifies the attribute value for the file or folder.
可选组件。指定文件或文件夹的属性值

Can take any of the following values or a combination of the following values:
可获取下列变量中的其中一个值或多个值的组合

0 = Normal file
0 = 正常文件(Normal file)
1 = Read-only file
1 = 只读文件(Read-only file)
2 = Hidden file
2 = 隐藏文件(Hidden file)
4 = System file
4 = 系统文件(System file)
16 = Folder or directory
16 = 文件夹或目录(Folder or directory)
32 = File has changed since last backup
32 = 在最后一次备份之后又被修改过的文件(File has changed since last backup)
1024 = Link or shortcut
1024 = 超链接或者快捷方式(Link or shortcut)
2048 = Compressed file
2048 = 压缩文件(Compressed file)

Example for the File object
文件对象举例

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

Example for the Folder object
文件夹对象举例

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

评论 (0) All

登陆 | 还没注册?