ASP Attributesプロパティ


Folder 对象参考手册Folder オブジェクトの完全なリファレンス

Attributes プロパティは、指定したファイルまたはフォルダーの属性を設定または返すために使用します。

構文

FileObject.Attributes[=newattributes]

FolderObject.Attributes[=newattributes]

パラメータ 説明
newattributes 省略可能です。ファイルまたはフォルダーの属性値を指定します。

次のいずれかの値、または次の値の組み合わせを使用できます:

0 = 通常のファイル。
1 = 読み取り専用ファイル。
2 = 隠しファイル。
4 = システムファイル。
16 = フォルダーまたはディレクトリ。
32 = 前回のバックアップ後に変更されたファイル。
1024 = リンクまたはショートカット。
2048 = 圧縮ファイル。

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


Folder 对象参考手册Folder オブジェクトの完全なリファレンス その他の拡張