我使用此代码(如下)阅读网页回复,但是,我收到的回复不完整。如果我System.Threading.Thread.Sleep(5000);
,在我运行GetResponseStream();
之后,我会得到完整的回复。
HttpWebRequest http = (HttpWebRequest)HttpWebRequest.Create(url))
HttpWebResponse response = (HttpWebResponse) http.GetResponse();
using (StreamReader sr = new StreamReader(response.GetResponseStream()))
{
string response = sr.ReadToEnd();
}
在完成之前我该如何屈服?