C# 始终冻结在httpwebresponse,无法执行任何操作
当我运行断点时。我发现它在webresponse上被卡住了。C# 始终冻结在httpwebresponse,无法执行任何操作,c#,android,httpwebresponse,C#,Android,Httpwebresponse,当我运行断点时。我发现它在webresponse上被卡住了。 为什么?尝试在Asyntask中运行,并在onPostExecute方法中获得所需的结果 运行程序时,您没有收到任何响应或异常吗。。? HttpWebRequest webRequest = WebRequest.Create("http://127.0.0.1/login.php?id=boonjye91") as HttpWebRequest; HttpWebResponse response = webRequest.GetR
为什么?尝试在Asyntask中运行,并在onPostExecute方法中获得所需的结果
运行程序时,您没有收到任何响应或异常吗。。?
HttpWebRequest webRequest = WebRequest.Create("http://127.0.0.1/login.php?id=boonjye91") as HttpWebRequest;
HttpWebResponse response = webRequest.GetResponse() as HttpWebResponse;
response.Close();
// Read the response
StreamReader reader = new StreamReader(response.GetResponseStream());
var responseText = reader.ReadToEnd();
// This just shows the server's response, but you'll probably want to do other things
Toast.MakeText(this, responseText, ToastLength.Long).Show();