Server.MapPath is slow. Use HttpRuntime.AppDomainAppPath. As long as your web site is running, this property will be always available to you.
Use it like this:
string tempPath = Path.Combine(HttpRuntime.AppDomainAppPath, "/temp/");
Posted On:
26-Jan-2021 01:19