Jul 12, 2011

Get Physical Path using Asp.Net

Hello Friend,

I have found to get physical path from different way.

1) On .aspx.cs Page
string path = Server.MapPath("/");

2) On Class File (.CS) Page
String Path = HttpContext.Current.Server.MapPath("/");

3) If you are using Thread and want to get physical path in .CS or .asax file
String Path = HttpContext.AppDomainAppPath.Replace("//","\\");

No comments:

Post a Comment