string username = this.textBox1.Text;
string password = this.textBox2.Text;
string AA = HttpUtility.UrlEncode(username, Encoding.UTF8);
string bb = HttpUtility.UrlEncode(password, Encoding.UTF8);
ASCIIEncoding encoding = new ASCIIEncoding();
String content = "";
try
{
string json = "{/"uname/":/"" + AA + "/",/"psw/":/"" + bb + "/",/"param/":/"login/"}";
MessageBox.Show(json);
JObject o = JObject.Parse(json);
String param = o.ToString();
byte[] data = encoding.GetBytes(param);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("
winfrom如何通过http来进行通信,并且通过传递json格式的数据可接受json格式的数据
最新推荐文章于 2023-05-22 00:01:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)