• Determine the
Physical Path of your Host |
Despite what your host may have told you, there is a Physical Path
to your web.
Best of all, you can use ASP to determine the Physical
Path Of Your Virtual Website for yourself.
Here is an example if you are hosting your
Domain on some random ISP and you want to know the structure of
the web site without asking them.
The MapPath
Method Is your tool.
Run the following code from within the root
of your site and it returns the physical path for you to see.
<p
align="center"><font size="4"
face="Arial"><b>
The Physical path to this virtual website is:
</b></font>
<font color="#FF0000" size="6"
face="Arial">
<%=
Server.MapPath("\")%>
</font></p>
Server.MapPath is a great tool, but it isn't
always the best solution. It is great for applications that need
to work from
any directory or site they are thrown into but there are times
when you just don't need to use it..
All Server.MapPath really does is figure out the physical path on the fly. Using it is really no different then knowing
the path except every time Server.MapPath is called you are using server resources to determining the physical
path. Also. when called from different directories Server.MapPath will report back different paths making it difficult
to use with an application that uses include files for specifying the database path.
The solution?
Just use Server.MapPath once to determine the physical path.
There is a Physical Path despite what your host may have told you.
|