ASP PathPropiedad


Drive 对象参考手册Manual de referencia completo del objeto Drive

La propiedad Path se utiliza para devolver la ruta de la unidad, archivo o carpeta especificados.

Nota:Para las unidades, la ruta no incluye el directorio raíz. Por ejemplo, la ruta de la unidad C es C:, no C:\.

Sintaxis

DriveObject.Path

FileObject.Path

FolderObject.Path

Ejemplo para el objeto Drive

<%
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
%>

Salida:

The path is C:

Ejemplo para el objeto File

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\asp\test\test.asp")
Response.Write("The path is: " & f.Path)
set f=nothing
set fs=nothing
%>

Salida:

The path is: c:\asp\test\test.asp

Ejemplo para el objeto 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
%>

Salida:

The path is: c:\asp\test


Drive 对象参考手册Manual de referencia completo del objeto Drive Otras extensiones