111,097
社区成员




string url = "http://xxxxxxx/websms/thirdMsg.do?method=execute";
HttpWebRequest webrequest = (HttpWebRequest)HttpWebRequest.Create(url);
webrequest.Method = "post";
webrequest.ContentType = "application/json";
string coderstr = "\"code\":\"test\"";
string passwordstr = "\"password\":\"111111\"";
string content = "\"content\":\"测试!\"";
string mobile = "\"mobile\";[\"" + dt.Rows[0]["Mobile"].ToString() + "\"]";
string commType = "\"commType\":\"1\"";
string replyFlag = "\"replyFlag\":\"0\"";
string replyTime = "\"replyTime\":\"" + Tools.GetDate().ToString("yyyyMMddHHmmss") + "\"";
string notEncrypting = "\"notEncrypting\"\"0\"";
string paramStr = "{" + coderstr + "," + passwordstr + "," + content + "," + mobile + "," + commType + "," + replyFlag + "," + replyTime + "," + notEncrypting + "}";
byte[] b = System.Text.Encoding.Default.GetBytes(paramStr);
string aa = Convert.ToBase64String(b);
byte[] ss = Encoding.UTF8.GetBytes(aa);
webrequest.ContentLength = ss.Length;
Stream stream;
stream = webrequest.GetRequestStream();
stream.p(ss, 0, ss.Length);
stream.Close();