An MapPath way is to use MapPath with a wildcard ~ :
string imagePath = MapPath("~/image/turnon.bmp");
As Dan Csharpster stated in the comments, since the Server object that the MapPath method MapPath is not directly accessible in the class library, the command should be
string imagePath = HttpContext.Current.Server.MapPath("~/image/turnon.bmp");
Erick petrucelli
source share