Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 始终冻结在httpwebresponse,无法执行任何操作_C#_Android_Httpwebresponse - Fatal编程技术网

C# 始终冻结在httpwebresponse,无法执行任何操作

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

当我运行断点时。我发现它在webresponse上被卡住了。
为什么?

尝试在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();