ASP Attributes 属性
定義と使用方法
Attributes 属性は、指定されたファイルまたはフォルダの属性を設定または返します。
構文:
FileObject.Attributes[=newattributes] FolderObject.Attributes[=newattributes]
パラメータ | 説明 |
---|---|
newattributes |
オプション。ファイルまたはフォルダの属性値を指定します。 以下のいずれかの値または以下の値の組み合わせが使用できます:
|
File オブジェクトの例
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.GetFile("c:\test.txt") Response.Write("ファイルの属性は: ") Response.Write("}}")f.Attributes) set f=nothing fs=nothing に設定 %>
出力:
ファイルの属性は: 32
Folder オブジェクトの例
<% dim fs,fo set fs=Server.CreateObject("Scripting.FileSystemObject") set fo=fs.GetFolder("c:\test") Response.Write("フォルダの属性は: ") Response.Write("}}")fo.Attributes) fo=nothing に設定 fs=nothing に設定 %>
出力:
フォルダの属性は:16