///////// /// 手机号码 /// 短信内容 /// 账号 /// 密码 /// 返回值 ///1则成功 private static string SendMsgByRuiHua(string phone, string content, string UserID, string PassWord, ref string result) { string contents = System.Web.HttpUtility.UrlEncode(content, System.Text.Encoding.GetEncoding("gbk")); string strSend = "http://183.60.176.8:8080/Message.sv?method=sendMsg&userCode=" + UserID + "&userPwd=" + PassWord + "&numbers=" + phone + "&msgContent=" + contents + "&charset=gbk"; WebRequest webRequest = WebRequest.Create(strSend); WebResponse respone = webRequest.GetResponse(); Stream stream = respone.GetResponseStream(); StreamReader reader = new StreamReader(stream, System.Text.Encoding.Default); string num = reader.ReadToEnd(); respone.Close(); string[] resultNum = num.ToString().Trim().Split(','); int firstNum = Convert.ToInt32(resultNum[0]) > 0 ? Convert.ToInt32(resultNum[0]) : -1; if(firstNum > 0) { result = "{success:true}"; } else { result = "{success:false}"; } return result; }