ASP Type 屬性
asp type 屬性

type 屬性用于返回指定文件或文件夾的類型。
語法
fileobject.type
folderobject.type
folderobject.type
針對 file 對象的實例
<%
dim fs,f
set fs=server.createobject("scripting.filesystemobject")
set f=fs.getfile("c:\test.txt")
response.write("the file test.txt is of type: ")
response.write(f.type)
set f=nothing
set fs=nothing
%>
輸出:
the file test.txt is of type: text document
dim fs,f
set fs=server.createobject("scripting.filesystemobject")
set f=fs.getfile("c:\test.txt")
response.write("the file test.txt is of type: ")
response.write(f.type)
set f=nothing
set fs=nothing
%>
輸出:
the file test.txt is of type: text document
<%
dim fs,f
set fs=server.createobject("scripting.filesystemobject")
set f=fs.getfile("c:\test.asp")
response.write("the file test.asp is of type: ")
response.write(f.type)
set f=nothing
set fs=nothing
%>
輸出:
the file test.asp is of type: active server document
dim fs,f
set fs=server.createobject("scripting.filesystemobject")
set f=fs.getfile("c:\test.asp")
response.write("the file test.asp is of type: ")
response.write(f.type)
set f=nothing
set fs=nothing
%>
輸出:
the file test.asp is of type: active server document
針對 folder 對象的實例
<%
dim fs,fo
set fs=server.createobject("scripting.filesystemobject")
set fo=fs.getfolder("c:\test")
response.write("the folder test is of type: ")
response.write(fo.type)
set fo=nothing
set fs=nothing
%>
輸出:
the folder test is of type: file folder
dim fs,fo
set fs=server.createobject("scripting.filesystemobject")
set fo=fs.getfolder("c:\test")
response.write("the folder test is of type: ")
response.write(fo.type)
set fo=nothing
set fs=nothing
%>
輸出:
the folder test is of type: file folder

相關文章
- ASP Dictionary 對象
- ASP Line 屬性
- ASP SkipLine 方法
- ASP Name 屬性
- ASP Type 屬性
- ASP SubFolders 集合
- ASP CacheControl 屬性
- ASP Expires 屬性
- ASP ExpiresAbsolute 屬性
- ASP Clear 方法
- ASP End 方法
- ASP QueryString 集合
- ASP Contents.RemoveAll 方法
- ASP Abandon 方法
- ASP Execute 方法
- ASP CopyFolder 方法
- ASP FolderExists 方法
- ASP GetFolder 方法
- ASP GetParentFolderName 方法
- ASP MoveFile 方法