metodo ASP GetAbsolutePathName
Metodo GetAbsolutePathName restituisce il percorso completo per il percorso specificato dalla radice del drive è iniziata.
grammatica
FileSystemObject.GetAbsolutePathName(path)
参数 | 描述 |
---|---|
path | 必需的。需修改为完整路径的路径。 |
Esempi
Supponendo che la directory corrente è C: \ temp \ test:esempio 1
<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("c:")
response.write(path)
%>
输出:
c:\temp\test
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("c:")
response.write(path)
%>
输出:
c:\temp\test
esempio 2
<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("mydoc.txt")
response.write(path)
%>
输出:
c:\temp\test\mydoc.txt
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("mydoc.txt")
response.write(path)
%>
输出:
c:\temp\test\mydoc.txt
esempio 3
<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("private\mydoc.txt")
response.write(path)
%>
输出:
c:\temp\test\private\mydoc.txt
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("private\mydoc.txt")
response.write(path)
%>
输出:
c:\temp\test\private\mydoc.txt
Completa FileSystemObject Object Reference