ປະສົມປະກອບ Type ASP

ການອະທິບາຍແລະນຳໃຊ້

ປະສົມປະກອບ Type ຕົວໃຫ້ມີປະເພດຂອງເອກະສານຫຼືເປົ່າຫຼັກ

ວິທີການ:

FileObject.Type
FolderObject.Type

ຕົວຢ່າງສຳລັບໂອກາດ File

ຕົວຢ່າງ 1

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:test.txt")
ການຂຽນຂໍ້ຄວາມ: "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

ຕົວຢ່າງ 2

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:test.asp")
ການຂຽນຂໍ້ຄວາມ: "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")
ການຂຽນຂໍ້ຄວາມ: "The folder test is of type: "
Response.Write(fo.Type)
set fo=nothing
set fs=nothing
%>

ຄຳພາບອອກ:

ການທົດລອງອຸປະກອນສາຍ: File Folder