Atribut Attributes ASP
Definisi dan Penggunaan
Atribut Attributes digunakan untuk menetapkan atau mengembalikan atribut berkas atau folder yang ditentukan.
Syarat:
FileObject.Attributes[=newattributes] FolderObject.Attributes[=newattributes]
Parameter | Deskripsi |
---|---|
newattributes |
Opsional. Tentukan nilai properti berkas atau folder. Dapat memilih salah satu dari berikut atau kombinasi dari berikut:
|
Contoh untuk objek Berkas
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.GetFile("c:\test.txt") Response.Write("Ciri-ciri berkas adalah: ") Response.Write("}}")f.Attributes) set f=nothing set fs=nothing %>
Output:
Ciri-ciri berkas adalah: 32
Contoh untuk objek Folder
<% dim fs,fo set fs=Server.CreateObject("Scripting.FileSystemObject") set fo=fs.GetFolder("c:\test") Response.Write("Ciri-ciri folder adalah: ") Response.Write("}}")fo.Attributes) set fo=nothing set fs=nothing %>
Output:
Atribut folder adalah: 16