<p>Newbie question...</p>

<p>If I have a file that is in the root of the web app.   How do I programmaticaly query the path of that file?  ie, what directory it is in?</p>

```
```
System.Web.HttpServerUtility.MapPath( "~/filename.ext" );
```
```
will give you the physical (disk) path, which you would use with System.IO methods and such.
```
```
System.Web.Hosting.VirtualPathUtility.ToAbsolute( "~/filename.ext" );
```
```
will give you the "absolute" virtual path.  This won't be the full url, but isn't necessarily the root of the domain, either.  It could be something like
```
/admin/filename.ext
```
if the application is rooted in a subdirectory.