ASP Attributes 屬性
❮ Complete File Object Reference
Attributes 屬性用於設定或返回指定檔案或資料夾的屬性。
語法
FileObject.Attributes[=newattributes]
FolderObject.Attributes[=newattributes]
引數 | 描述 |
---|---|
newattributes | 可選。為檔案或資料夾指定屬性值。 可以接受以下任何值或這些值的組合 0 = Normal file |
File 物件示例
<%
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
Folder 物件示例
<%
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
❮ Complete File Object Reference