Letterman
Letterman

Reputation: 4216

How should I combine two paths including backwards relative paths?

I have an absolute path, and a relative path, and I want to combine the two, is there any built-in way?

The relative path can be as well "../../aa2/file.exe".

(path.combine does not support it - which is pretty bizarre by itself.)

Upvotes: 3

Views: 2515

Answers (1)

Shay Erlichmen
Shay Erlichmen

Reputation: 31928

Try Path.GetFullPath(Path.Combine(abs, rel))

Upvotes: 15

Related Questions