ASP Type 属性

定義と用法

Type 属性は指定されたファイルまたはフォルダーのタイプを返すために使用されます。

文法:

FileObject.Type
FolderObject.Type

针对 File オブジェクトの例

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:help.txt")
Response.Write("The file test.txt is of type: ")
Response.Write(f.Type)
f = nothing
fs = nothing
%>

出力:

The file help.txt is of type: Text Document

针对 Folder オブジェクトの例

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:help.asp")
Response.Write("The file test.asp is of type: ")
Response.Write(f.Type)
f = nothing
fs = nothing
%>

出力:

ファイル help.asp のタイプは Active Server Document です