ASP Attributesプロパティ


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

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


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