ASP Path Attribute
ການອະທິບາຍ ແລະ ການນໍາໃຊ້
ປະສົງ Path ຕົວເລື່ອງຂອງດາວເຄື່ອງໃຫຍ່, ບັນດາເອກະສານຫຼືທາງຖະບານບັນດາເອກະສານ.
ຄວາມຄິດ:ສຳລັບດາວເຄື່ອງໃຫຍ່ທີ່ເຄື່ອງໃຫຍ່ທີ່ບໍ່ມີຫົວເປົ່າ. ເວລາທາງຖະບານຂອງເຄື່ອງໃຫຍ່ C ມີທາງຖະບານ C:, ບໍ່ມີ C:\.
ນິຍາຍ:
DriveObject.Path FileObject.Path FolderObject.Path
ຄວາມປະກອບ
ສະແດງຄວາມຄິດຂອງ Drive Object
<% dim fs,d set fs=Server.CreateObject("Scripting.FileSystemObject") set d=fs.GetDrive("c:") Response.Write("The path is " & d.Path) set d=nothing set fs=nothing %>
Output:
ທາງຖະບານ: C:
ສະແດງຄວາມຄິດຂອງ File Object
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.GetFile("d:\asp\test\test.asp") Response.Write("The path is: " & f.Path) set f=nothing set fs=nothing %>
Output:
ທາງຖະບານ: D:\asp\test\test.asp
ສະແດງຄວາມຄິດຂອງ Folder Object
<% dim fs,fo set fs=Server.CreateObject("Scripting.FileSystemObject") set fo=fs.GetFolder("d:\asp\test") Response.Write("The path is: " & fo.Path) set fo=nothing set fs=nothing %>
Output:
The path is: D:\asp\test