ASP Type 属性

asp type 属性

file 对象参考手册 完整的 file 对象参考手册

type 属性用于返回指定文件或文件夹的类型。

语法

fileobject.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.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

file 对象参考手册 完整的 file 对象参考手册
相关文章