我試過這個代碼在一個正常的C#應用程序,它工作正常。在monodroid中,當我嘗試以任何方式從流(或基本流)讀取時,它完全錯誤(換句話說,甚至沒有嘗試捕獲工作)。請幫助:Monodroid WebRequest炸彈應用程序
try
{
WebRequest request = WebRequest.Create(string.Format("http://maps.google.com/maps/geo?q={0},{1}&output=xml&sensor=false", "35.245619","-98.276369"));
WebResponse wresponse = request.GetResponse();
using (StreamReader sr = new StreamReader(wresponse.GetResponseStream()))
{
RunOnUiThread(() => _debug.Text = (sr.ReadToEnd()).ToString());
}
wresponse.Close();
}
catch (Exception ex)
{
RunOnUiThread(() => _debug.Text = string.Format("Exception: ", ex.Message));
}
_debug是我的UI一個TextView對象。