C # Uri AppDomain.CurrentDomain.BaseDirectory relative path
2 answers
If you just want to grow one or more folders and then downwards, you can use something like this.
To get a file with two folders up:
AppDomain.CurrentDomain.BaseDirectory+"..\\..\\Program.cs"
To get a file with two folders up and one down:
AppDomain.CurrentDomain.BaseDirectory + "..\\..\\Properties\\AssemblyInfo.cs"
If you just want a path, you can do something like this:
Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory + "..\\..\\Properties\\");
+8
source to share