ASP Type 속성

정의와 사용법

Type 속성은 지정된 파일이나 폴더의 유형을 반환합니다.

문법:

FileObject.Type
FolderObject.Type

File 객체에 대한 예제

예제 1

<%
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
fs=nothing 설정
%>

출력:

The file test.txt is of type: Text Document

예제 2

<%
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
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)
fo=nothing 설정
fs=nothing 설정
%>

출력:

폴더 테스트는 파일 폴더 유형입니다: