free e- mail
thaimail
hotmail
yahoo
siam2you
thammasat
Home
Visual Basic
Active Server Page
JavaScript
Network
Other
Active Server Pages.
Server Object
All Methods
All Objects
All Properties
METHOD: Server.MapPath
Server.
MapPath
(Path)
The
MapPath
method maps a relative or virtual path to a physical path. This method does not check for the validity or the existence of the physical path. If the path starts with a forward or backward slash, the method returns the path as if the path is a full virtual path. If the path does not start with a slash, then the method returns the path relative to the directory of the ASP file being processed.
There is one mandatory argument.
Path
The
Path
argument is the path to be mapped.
Code:
<HTML>
<HEAD>
</HEAD>
<BODY>
The path of this file is <% Response.Write
Server.MapPath
("test.asp")
%>
The path of the file1 is <% Response.Write
Server.MapPath
("\test.asp")
%>
The path of the file2 is <% Response.Write
Server.MapPath
("test\test.asp")
%>
The path of the file3 is <% Response.Write
Server.MapPath
("\")
%>
</BODY>
</HTML>
Output:
The path of this file is D:\Inetpub\wwwroot\test.asp
The path of the file1 is D:\Inetpub\wwwroot\test\test.asp
The path of the file2 is D:\Inetpub\wwwroot\test\test.asp
The path of the file3 is D:\Inetpub\wwwroot
Copyright 2000 by Infinite Software Solutions, Inc.
Trademark Information
ASP - Link
ASP reference
B
C
D
E
F
G
Last update:
Copyright © 2001.Memo Wil@keo everything that I like Co.,Ltd.