为啥网页不显示post传入的数据

1 Encoding encoding = Encoding.GetEncoding("utf-8"); 2 string URL = "http://192.168.1.115/cccn/test_post.php"; 3 string postData = "username" + textBox1.Text.ToString() + "password" + textBox2.Text.ToString(); 4 byte[] data = encoding.GetBytes(postData); 5 HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(URL); 6 myRequest.Method = "POST"; 7 myRequest.ContentType = "application/x-www-form-urlencoded"; 8 myRequest.ContentLength = data.Length; 9 Stream st = myRequest.GetRequestStream(); 10 st.Write(data, 0, data.Length); 11 st.Close(); 12 HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); 13 Stream receiveStream = myResponse.GetResponseStream(); 14 StreamReader readStream = new StreamReader(receiveStream, encoding); 15 char[] read = new char[256]; 16 int count = readStream.Read(read, 0, 256); 17 String str = null; 18 while (count > 0) 19 { 20 str += new string(read, 0, count); 21 count = readStream.Read(read, 0, 256); 22 } 23 myResponse.Close(); 24 readStream.Close();
临摹微笑
浏览 504回答 5
5回答

慕侠2389804

楼主好像是提交了数据,但是对于返回的数据也是放到了字符串中,然后也没有显示的操作啊

慕的地10843

显示的操作,应该是在网页中。。。
打开App,查看更多内容
随时随地看视频慕课网APP