Properti Attributes ASP
Definisi dan penggunaan
Attributes properti digunakan untuk menetapkan atau mengembalikan atribut fail atau folder yang ditentukan.
Syarat:
FileObject.Attributes[=newattributes] FolderObject.Attributes[=newattributes]
Parameter | Penerangan |
---|---|
newattributes |
Pilihan. Tentukan nilai atribut fail atau folder. Boleh dipilih salah satu daripada nilai berikut atau gabungan daripada nilai berikut:
|
Contoh untuk objek Fail
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.GetFile("c:\test.txt") Response.Write("Sebarang atribut fail adalah:") Response.Write("}}")f.Attributes) set f=nothing set fs=nothing %>
Output:
The attributes of the file are: 32
Contoh untuk objek Folder
<% dim fs,fo set fs=Server.CreateObject("Scripting.FileSystemObject") set fo=fs.GetFolder("c:\test") Response.Write("Sebarang atribut folder adalah:") Response.Write("}}")fo.Attributes) set fo=nothing set fs=nothing %>
Output:
Atribut folder adalah: 16