Hi
Im writing a neat little app to fetch raw text content from a website.
However, the website im trying to get data from first sends me to a "bandwidth test site", then redirects me to the site i want data from. How can i handle this in c#?
Code so far;
VB Code:
String url = "http://www1.nrk.no/nett-tv/bokstav/@"; String content = ""; HttpWebRequest request=(HttpWebRequest)WebRequest.Create(url); request.AllowAutoRedirect=true; request.MaximumAutomaticRedirections=200; HttpWebResponse request = (HttpWebResponse)myHttpWebRequest.GetResponse(); // Gets the stream associated with the response. Stream receiveStream = request.GetResponseStream(); Encoding encode = System.Text.Encoding.GetEncoding("utf-8"); StreamReader readStream = new StreamReader( receiveStream, encode ); content = readStream.ReadToEnd(); textBox1.Text=content;
This only gets the inital page...so, how to get the redirect page?
madsun




Reply With Quote