最新のWeb開発のチュートリアル
 

ASP Attributes Property


<完全なファイルオブジェクト参照

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
%>

Output:

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
%>

Output:

The attributes of the folder are: 16

<完全なファイルオブジェクト参照