ASP Attributes Attribute

Paghahayag at Gamit

Ang Attributes attribute ay ginagamit upang itakda o ibalik ang attribute ng tinukoy na file o folder.

Syntaxa:

FileObject.Attributes[=newattributes]
FolderObject.Attributes[=newattributes]
Parametro Paglalarawan
newattributes

Optional. Tatakda ang halaga ng attribute ng file o folder.

Maaaring maging alinman sa mga sumusunod o kombinasyon ng mga sumusunod na halaga:

  • 0 = Normal file. Walang nagtatakda na attribute.
  • 1 = ReadOnly file. ReadWrite.
  • 2 = Nakatago na file. ReadWrite.
  • 4 = System file. ReadWrite.
  • 16 = Folder o directory.ReadOnly.
  • 32 = Naka-alinlangan na file matapos ang huling backup. ReadWrite.
  • 1024 = Link o shortcut.ReadOnly.
  • 2048 = Nakakumpresang file.ReadOnly.

Mga halimbawa para sa File object

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\test.txt")
Response.Write("Ang mga katangian ng file ay: ")
Response.Write("}}")f.Attributes)
set f=nothing
set fs=nothing
%>

Output:

Ang mga katangian ng file ay: 32

Mga halimbawa para sa Folder object

<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test")
Response.Write("Ang mga katangian ng folder ay: ")
Response.Write("}}")fo.Attributes)
set fo=nothing
set fs=nothing
%>

Output:

Ang mga katangian ng folder ay: 16