0

If I use an open file dialog box that returns the absolute value of the file this works just fine:

 BMP = new BitmapImage(new Uri(filename)); 

However, I want to have a text file that contains the names of the files, like this:

01TopographicalMap.bmp 01ElevationCompressed.elv 01Terrain.trn 01Placenames.pns 

These files are loaded sequentially. Unfortunately, the previous Uri(filename) call barfs because it wants the whole absolute path. We're already in the same folder. What do I have to do to get the Uri to just default to the folder it's already in?

Thanks, for the help.

1 Answer 1

2

You can use Directory.GetCurrentDirectory()

Or:

Path.Combine(Directory.GetCurrentDirectory(), filename);

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.