<Completa objetos Referência do Arquivo
A propriedade atributos é usado para definir ou devolver o atributo ou atributos de um arquivo ou pasta especificada.
Sintaxe
FileObject.Attributes[=newattributes]
FolderObject.Attributes[=newattributes]
Parâmetro | Descrição |
---|---|
newattributes | Opcional. especifica o valor do atributo para o arquivo ou pasta. Pode tomar qualquer um dos seguintes valores ou uma combinação dos seguintes valores: 0 = arquivo normal |
Exemplo para o objecto de ficheiro
<%
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
Exemplo para o objecto de pastas
<%
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
<Completa objetos Referência do Arquivo