Latest web development tutorials

ASP GetAbsolutePathName method

FileSystemObject Object Reference Complete FileSystemObject Object Reference

GetAbsolutePathName method returns the full path for the specified path from the root of the drive began.

grammar

FileSystemObject.GetAbsolutePathName(path)

参数 描述
path 必需的。需修改为完整路径的路径。

Examples

Assuming the current directory is c: \ temp \ test:

Example 1

<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("c:")
response.write(path)
%>

输出:

c:\temp\test

Example 2

<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("mydoc.txt")
response.write(path)
%>

输出:

c:\temp\test\mydoc.txt

Example 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


FileSystemObject Object Reference Complete FileSystemObject Object Reference