Properti Path ASP
Definisi dan Penggunaan
Properti Path digunakan untuk kembalikan jalur untuk driwer, file, atau folder yang ditentukan.
Syarat:
DriveObject.Path FileObject.Path FolderObject.Path
Contoh untuk objek Drive
<% dim fs,d set fs=Server.CreateObject("Scripting.FileSystemObject") set d=fs.GetDrive("e:") Response.Write("Jalur adalah " & d.Path) set d=nothing set fs=nothing %>
Output:
Jalur adalah E:
Contoh untuk objek File
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.GetFile("c:\asp\test.asp") Response.Write("Jalur adalah: " & f.Path) set f=nothing set fs=nothing %>
Output:
Jalur adalah: C:\asp\test.asp
Contoh untuk objek Folder
<% dim fs,fo set fs=Server.CreateObject("Scripting.FileSystemObject") set fo=fs.GetFolder("c:\asp\test") Response.Write("Jalur adalah: " & fo.Path) set fo=nothing set fs=nothing %>
Output:
Jalur adalah: C:\asp\test