views:

27

answers:

1

Hi,

I am trying to fetch pages using "httpwebrequest", but the links also have relative path in them like (.../something/, ../.../something/) , i am trying to map them to absolute path, i am not too good at programming, do we have any utility helpers to do the job, any links, articles, tutorials appreciated.

Thank you in advance.

+2  A: 
var base = new Uri("http://stackoverflow.com/a/b/c/d.html");
var relative = new Uri(base, "../e.html"); // http://stackoverflow.com/a/b/e.html

Uri(Uri, String)
Uri.AbsolutePath

zerkms