E
Earl Teigrob
I am loading a page using WebClient using the code below. The thing is that
on a redirect, I do not end up knowing where the page was loaded from. I
need this information because I am parsing the downloaded HTML page and
replacing Relative references with Absolute references. I have read that
this can be accomplished using HttpWebRequest but have not idea how to
implement it to retrieve the final destination directory. If anyone has the
actual code snippet to do this, it would be a great help.
Thanks in Advance
Earl
private string HtmlPageContent(string PageUrl)
{
WebClient MyWebClient = new WebClient();
byte[] bPageHtml = MyWebClient.DownloadData(PageUrl);
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
return enc.GetString(bPageHtml);
}
on a redirect, I do not end up knowing where the page was loaded from. I
need this information because I am parsing the downloaded HTML page and
replacing Relative references with Absolute references. I have read that
this can be accomplished using HttpWebRequest but have not idea how to
implement it to retrieve the final destination directory. If anyone has the
actual code snippet to do this, it would be a great help.
Thanks in Advance
Earl
private string HtmlPageContent(string PageUrl)
{
WebClient MyWebClient = new WebClient();
byte[] bPageHtml = MyWebClient.DownloadData(PageUrl);
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
return enc.GetString(bPageHtml);
}