C # Uri AppDomain.CurrentDomain.BaseDirectory relative path

How do you get the relative path to AppDomain.CurrentDomain.BaseDirectory in the Uri.

I need to increment "cd ......" from AppDomain.CurrentDomain.BaseDirectory and then move to other folders.

Do you know how?

Thank you in advance

Hello

+3


source to share


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


I ended up using the following:



System.IO.Path.Combine (AppDomain.CurrentDomain.BaseDirectory, @ "...... \ www \");

+1


source







All Articles