Skip to content

Converting a relative link to an absolute link

Ian Journeaux

Asked Jan 12, 2013, 6:15 PM EST1 answer
Share
LinkedInX
I am reading a web page with

HttpWebRequest site = (HttpWebRequest)WebRequest.Create(link);               
Code
HttpWebResponse response = (HttpWebResponse)site.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader read = new StreamReader(dataStream);
String data = read.ReadToEnd();

I am parsing the page out to locate some download links but the download links are relative links. I was wondering what the correct method would be to convert it to an absolute link?

Thanks

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Akkiraju Ivaturi
    0
    Please check if Page.ResolveURL works for you.
    0