Atribut Type ASP

Definisi dan Penggunaan

Atribut Type digunakan untuk mengembalikan jenis fail atau folder yang ditentukan.

Syarat:

FileObject.Type
FolderObject.Type

Contoh untuk objek Fail

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:help.txt")
Response.Write("Failah test.txt adalah jenis: ")
Response.Write("}}")f.Type)
set f=nothing
set fs=nothing
%>

Output:

Failah help.txt adalah jenis: Dokumen Teks

Contoh untuk objek Folder

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:help.asp")
Response.Write("Failah test.asp adalah jenis: ")
Response.Write("}}")f.Type)
set f=nothing
set fs=nothing
%>

Output:

Berkas help.asp adalah jenis: Active Server Document