Coming from this question, i'm looking for a way to cascade a url like Path.Combine
for file system does including a path-parameter.
My input are the following 3 parameters:
string host = "test.com"; //also possilbe: "test.com/"
string path = "/foo/"; //also possilbe: "foo", "/", "","/foo","foo/"
string file = "test.temp"; //also possilbe: "/test.temp"
The expected result is
http://test.com/foo/test.temp
This approach is the best I could find but it does'n work for all cases:
Uri myUri = new Uri(new Uri("http://" + host +"/"+ path), file);