Propriedade Path do ASP
Definição e uso
A propriedade Path é usada para retornar o caminho do drive, arquivo ou pasta especificado.
Sintaxe:
DriveObject.Path FileObject.Path FolderObject.Path
Exemplo para o objeto Drive
<% dim fs,d set fs=Server.CreateObject("Scripting.FileSystemObject") set d=fs.GetDrive("e:") Response.Write("O caminho é " & d.Path) set d=nothing set fs=nothing %>
Saída:
O caminho é E:
Exemplo para o objeto File
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.GetFile("c:\asp\test.asp") Response.Write("O caminho é: " & f.Path) set f=nothing set fs=nothing %>
Saída:
O caminho é: C:\asp\test.asp
Exemplo para o objeto Folder
<% dim fs,fo set fs=Server.CreateObject("Scripting.FileSystemObject") set fo=fs.GetFolder("c:\asp\test") Response.Write("O caminho é: " & fo.Path) set fo=nothing set fs=nothing %>
Saída:
O caminho é: C:\asp\test