Windows phone 7 远程服务器返回了一个错误notfound
我在foreach中的服务器上创建get请求Windows phone 7 远程服务器返回了一个错误notfound,windows-phone-7,windows-phone-8,Windows Phone 7,Windows Phone 8,我在foreach中的服务器上创建get请求 foreach (ulong id in IDList) GetData(Convert.ToInt32(id)); 我的请求: public void GetData(int id) { string url = String.Format(GET_URL, id); HttpWebRequest request = (HttpWebRequest)WebReques
foreach (ulong id in IDList)
GetData(Convert.ToInt32(id));
我的请求:
public void GetData(int id)
{
string url = String.Format(GET_URL, id);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "Get";
request.CookieContainer = _cookies;
request.BeginGetResponse(new AsyncCallback(ReadCallbackData), request);
}
以及我得到异常的响应:“远程服务器返回了一个错误notfound”
当我在emulator上测试时,我并没有得到这个异常,只有在设备上,当我有很多ID时,我才得到这个异常。当我有5-10个ID时,我也并没有得到这个异常
private void ReadCallbackData(IAsyncResult asynchronousResult)
{
try
{ HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState;
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asynchronousResult);
}
catch(Exception ex)
{}
}