1
我不明白爲什麼EndGetResponse()在下面的代碼返回null:HttpWebRequest.EndGetResponse()在Windows Phone 7.1上返回null?
private void Application_Launching(object sender, LaunchingEventArgs e)
{
var request = WebRequest.Create("http://www.microsoft.com");
using (var response = request.EndGetResponse(request.BeginGetResponse(ar => { }, null)))
using (var responseStream = response.GetResponseStream())
using (var reader = new StreamReader(responseStream))
{
string content = reader.ReadToEnd();
}
}
(繁殖,上面的代碼替換在新創建的Windows Phone應用程序的空Application_Launching處理)
這是一個框架中的錯誤嗎?