Here is how I do it:
HttpContext.Current.Server.MapPath(@"~\~\~\Content\")
HI know that ‘.’ is for the root of the project, but how to go a few folders back?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you really need the grandparent path, you can get it from the root path using
Path.GetDirectoryName():But your web app very likely won’t have permission to read or write there – I’m not sure what you’re going to do with it.