If you have a virtual directory:
string path = HttpContext.Current.Request.ApplicationPath;
If your site is on the root or a virtual directory:
string path = HttpContext.Current.Request.ApplicationPath;
if (path == "/")
path = "http://" + Request.Url.Host;
else
path += "/";
No comments:
Post a Comment