Using Server.MapPath in external C# Classes in ASP.NET

The ServerUtility class is available as an instance in your HttpContext. If you’re in an environment where you know it’ll be executed inside the ASP.Net pipeline, you can use

HttpContext.Current.Server.MapPath()

You’ll have to import System.Web though.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)