Atributo Path de ASP
Definición y uso
La propiedad Path se utiliza para devolver la ruta específica del dispositivo, archivo o la ruta del archivo.
Comentarios:Para los dispositivos, la ruta no incluye el directorio raíz. Por ejemplo, la ruta del dispositivo C es C: en lugar de C:\.
Sintaxis:
DriveObject.Path FileObject.Path FolderObject.Path
Instancia
Ejemplo para el objeto Drive
<% dim fs,d set fs=Server.CreateObject("Scripting.FileSystemObject") set d=fs.GetDrive("c:") Response.Write("La ruta es " & d.Path) set d=nothing set fs=nothing %>
Salida:
La ruta es C:
Ejemplo para el objeto File
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.GetFile("d:\asp\test\test.asp") Response.Write("La ruta es: " & f.Path) set f=nothing set fs=nothing %>
Salida:
La ruta es: D:\asp\test\test.asp
Ejemplo para el objeto Folder
<% dim fs,fo set fs=Server.CreateObject("Scripting.FileSystemObject") set fo=fs.GetFolder("d:\asp\test") Response.Write("La ruta es: " & fo.Path) set fo=nothing set fs=nothing %>
Salida:
La ruta es: D:\asp\test