Return To Home Page - Link to "The Wanker" - Contact Us


Return To Home Page

Use ASP to determine the Physical Path Of Your Virtual Website



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 Mapath Method Is your ticket.

Run the following code from within the root of your site and it will clue you in to the physical path.

<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 determine the physical path. Also. when called from all sorts of different directories Server.MapPath will report back all sorts of different paths making it pretty 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.

Banner
ASP (Active Server Pages) is a technology developed by Microsoft. Pages using ASP are primarily developed in JScript, or VBScript and are integrated into the HTML of your Web pages. The ASP code is compiled on-the-fly by the server and the resulting output is standard HTML. By using ASP, Web pages can be dynamic, full of ever-changing content, and browser independent.
Active Server Pages ASP control controls class classes module script Scripts applet CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com,www.abay.com

 

Link to "The Wanker"
© 2007 CodeWanker - Active Server Pages Articles, Code Snippets, & Tutorials