ASP Attributes属性

定義と使用方法

Attributes属性は、指定されたファイルまたはフォルダの属性を設定または返すために使用されます。

構文:

FileObject.Attributes[=newattributes] 
FolderObject.Attributes[=newattributes]
パラメータ 説明
newattributes

オプション。ファイルまたはフォルダの属性値を指定します。

以下の値のいずれか、または以下の値の組み合わせを利用します:

  • 0 = 通常のファイル
  • 1 = 読み取り専用ファイル
  • 2 = 非表示ファイル
  • 4 = システムファイル
  • 16 = フォルダまたはディレクトリ
  • 32 = 最後にバックアップしてからファイルが変更されています
  • 1024 = リンクまたはショートカット
  • 2048 = 圧縮ファイル

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\test.txt")
Response.Write("ファイルの属性は以下の通りです:")
Response.Write("}}")f.Attributes)
f = nothing set
fs = nothing set
%>

出力:

ファイルの属性は:32