Server.MapPath("~");
Will get you the root directory of the current application, as a path on the disk. E.g., C:\inetpub\...
Note that the ~ character can be used as part of web paths in ASP.NET controls as well, it’ll fill in the URL to your application.
If your class doesn’t have Server property, you can use static
HttpContext.Current.Server.MapPath("~")