Again, it's confusing to read the folder path in the C # class with WebForm (ASP. NET).
C # classes generally have a few
// Directory folders under the root directory string " .. /.. /directory"; // Debug under Project bin string path2 = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase; // AppDomain.CurrentDomain.BaseDirectory // Debug under Project Bin (not used) string
WebForm under the Server.MapPath
//where to get the application root directory stringpath1 = Server.MapPath ("/"); //get the current directory on your page, equivalent to Server.MapPath ("") stringpath2 = Server.MapPath ("./"); //get the current application-level program directory, if it is the root directory, is the root directory, if it is a virtual directory, is the location of the virtual directory stringPath3 = Server.MapPath ("~");
C # Read Path