Local Dir

  • Thread starter Thread starter Ryan Moore
  • Start date Start date
Hey,

Request.ApplicationPath will get you the virtual directory for the app.
Server.MapPath will get you the physical path

Response.Write(Request.ApplicationPath);
will return
/CodePlay
which is the actual virtual dir for my web app.
and
Response.Write(Server.MapPath(Request.ApplicationPath));
will return
c:\inetpub\wwwroot\CodePlay
which is also correct physical path on hdd

Chao,

Hermit Dave
 
how bout
Response.Write(Request.Url.Scheme + "://" + Request.Url.Host +
Request.ApplicationPath);

That should sort you out....

Hermit Dave
 
Back
Top