Get Project URL

1

Hello, I need to get the url where my project (wpf) is located. The reason is this: there is an image upload to the Image folder (which is in the solution of my project) and I need the url of it so that the image is saved in the correct folder. I could put it manually, but every time I switch computers, I would have to change and this is not very feasible.

    
asked by anonymous 10.05.2015 / 16:49

1 answer

1

One way would be to use System.AppDomain.BaseDirectory to find files or directories that are in the same project directory.

Another way would be to use Environment.CurrentDirectory , but it is not recommended as the value may change during the execution of the program.

    
11.05.2015 / 16:12