完整的 FileSystemObject 对象参考手册
GetAbsolutePathName 方法为指定路径返回从根驱动器开始的完整路径。
语法
FileSystemObject.GetAbsolutePathName(path)
参数 | 描述 |
---|---|
path | 必需的。需修改为完整路径的路径。 |
实例
假设当前目录是 c:temptest:实例 1
<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("c:")
response.write(path)
%>
输出:
c:temptest
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("c:")
response.write(path)
%>
输出:
c:temptest
实例 2
<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("mydoc.txt")
response.write(path)
%>
输出:
c:temptestmydoc.txt
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("mydoc.txt")
response.write(path)
%>
输出:
c:temptestmydoc.txt
实例 3
<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("privatemydoc.txt")
response.write(path)
%>
输出:
c:temptestprivatemydoc.txt
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("privatemydoc.txt")
response.write(path)
%>
输出:
c:temptestprivatemydoc.txt
完整的 FileSystemObject 对象参考手册其他扩展