องค์ประกอบ Path ของ ASP
การระบุและการใช้งาน
องค์ประกอบ Path ใช้เพื่อกลับส่งรายละเอียดทางด้านเส้นทางของไดรฟ์, ไฟล์ หรือโฟลเดอร์ที่กำหนด
การใช้งาน:
DriveObject.Path FileObject.Path FolderObject.Path
สำหรับตัวแปร Drive ตัวอย่าง
<% dim fs,d set fs=Server.CreateObject("Scripting.FileSystemObject") set d=fs.GetDrive("e:") Response.Write("The path is " & d.Path) set d=nothing set fs=nothing %>
ออกแบบ:
รายละเอียดทางด้านเส้นทาง: E:
สำหรับตัวแปร File ตัวอย่าง
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.GetFile("c:\asp\test.asp") Response.Write("The path is: " & f.Path) set f=nothing set fs=nothing %>
ออกแบบ:
รายละเอียดทางด้านเส้นทาง: C:\asp\test.asp
สำหรับตัวแปร Folder ตัวอย่าง
<% dim fs,fo set fs=Server.CreateObject("Scripting.FileSystemObject") set fo=fs.GetFolder("c:\asp\test") Response.Write("The path is: " & fo.Path) set fo=nothing set fs=nothing %>
ออกแบบ:
พาธ: C:\asp\test