Files

(PWS4 IIS4 IIS5)
Files — 指定されたフォルダ内にあるすべての File オブジェクトの入った Files コレクションを返します。このコレクションには、隠しファイルやシステム ファイルの属性を持つ File オブジェクトも含まれます。

構文

object.Files

パラメータ

object
Folder オブジェクトを指定します。

戻り値

Files コレクションを返します。

説明

フォルダから Files コレクションを作成します。

JScript

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function ShowFolderFileList(folderspec)
{
   var fso, f, fc, s;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   f = fso.GetFolder(folderspec);
   fc = new Enumerator(f.files);
   s = "";
   for (; !fc.atEnd(); fc.moveNext())
   {
      s += fc.item();
      s += "<br />";
   }
   return(s);
}

VBScript

1
2
3
4
5
6
7
8
9
10
11
Function ShowFileList(folderspec)
   Dim fso, f, f1, fc, s
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.GetFolder(folderspec)
   Set fc = f.Files
   For Each f1 in fc
      s = s & f1.name
      s = s &   "<br />"
   Next
   ShowFileList = s
End Function

関連ページ