hi,
I have the following code. It hangs out and waits infinitely on
StreamReader.Read method.
any ideas?
thanks in advance...
WebRequest myHttpWebRequest = WebRequest.Create(myUri);
myResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
Stream ReceiveStream = myResponse.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding(1254);
StreamReader sr = new StreamReader(ReceiveStream, encode);
Char[] read = new Char[1024];
int count = sr.Read(read, 0, 1024);
StringBuilder strHTML = new StringBuilder();
while (count > 0 && strHTML.Length <= MAX_SIZE)
{
String str = new String(read, 0, count);
strHTML.Append(str);
count = sr.Read(read, 0, 1024); ----> hangs out here....
}
sr.Close();