Latest web development tutorials

ASP atributos de la propiedad

Archivo de referencia de objetos Archivo Referencia completa de objetos

Atributos de los conjuntos de propiedades o devuelve los archivos o carpetas de propiedad especificada.

gramática

FileObject.Attributes[=newattributes]

FolderObject.Attributes[=newattributes]

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

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

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

Para objeto de instancia del archivo

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

Por ejemplo, objeto de carpeta

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


Archivo de referencia de objetos Archivo Referencia completa de objetos