K
KevinB
I'm doing screen scraping from a Windows Application and dumping certain data
into a SqlDb, it's one of our parent websites, through a Proxy server using
the the WebClient class. I have used the WebRequest/Response classes but the
only benefit I got from that was the abiliy to control the timeout on the
WebResponse. I can control the timeout on the ProxyServer here and that's
all I need. For the issue I'm having the code below should suffice:
System.Net.WebClient wc = new System.Net.WebClient();
System.Net.WebProxy wp = new System.Net.WebProxy();
wp.UseDefaultCredentials = true;
wc.Headers.Add("User-Agent", "Mozilla/4.0+");
wc.Proxy = wp;
strm = wc.OpenRead(nextSubURL);
System.IO.StreamReader sr = new System.IO.StreamReader(strm);
System.IO.StringReader strReader = new System.IO.StringReader(sr.ReadToEnd());
Here's my problem, eventually I'm getting a timeout on sr.ReadToEnd. I'm
not getting it everytime; could it be that some pages being dumed into the
StreamReader are just to big? I know that I can't control that but if there a
way to stop that from timing out?
Thanks everyone.
into a SqlDb, it's one of our parent websites, through a Proxy server using
the the WebClient class. I have used the WebRequest/Response classes but the
only benefit I got from that was the abiliy to control the timeout on the
WebResponse. I can control the timeout on the ProxyServer here and that's
all I need. For the issue I'm having the code below should suffice:
System.Net.WebClient wc = new System.Net.WebClient();
System.Net.WebProxy wp = new System.Net.WebProxy();
wp.UseDefaultCredentials = true;
wc.Headers.Add("User-Agent", "Mozilla/4.0+");
wc.Proxy = wp;
strm = wc.OpenRead(nextSubURL);
System.IO.StreamReader sr = new System.IO.StreamReader(strm);
System.IO.StringReader strReader = new System.IO.StringReader(sr.ReadToEnd());
Here's my problem, eventually I'm getting a timeout on sr.ReadToEnd. I'm
not getting it everytime; could it be that some pages being dumed into the
StreamReader are just to big? I know that I can't control that but if there a
way to stop that from timing out?
Thanks everyone.