ASP Type 属性

定义和用法

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

语法:
  1. FileObject.Type
  2. FolderObject.Type

针对 File 对象的例子

  1. <%
  2. dim fs,f
  3. set fs=Server.CreateObject("Scripting.FileSystemObject")
  4. set f=fs.GetFile("c:help.txt")
  5. Response.Write("文件 test.txt 的类型为: ")
  6. Response.Write(f.Type)
  7. set f=nothing
  8. set fs=nothing
  9. %>

输出:

  1. 文件 test.txt 的类型为: Text Document

针对 Folder 对象的例子

  1. <%
  2. dim fs,f
  3. set fs=Server.CreateObject("Scripting.FileSystemObject")
  4. set f=fs.GetFile("c:help.asp")
  5. Response.Write("文件 test.asp 的类型为: ")
  6. Response.Write(f.Type)
  7. set f=nothing
  8. set fs=nothing
  9. %>

输出:

  1. 文件 test.asp 的类型为: Active Server Document

分类导航