发送短信
来源:互联网 发布:福建11选5遗漏数据查询 编辑:程序博客网 时间:2024/05/16 07:25
1.短信格式:您名下的学生:学生名字 编号:123,2017/01/01在留学管家修改了邮箱地址,原邮箱为:sun@xx.com 新邮箱为:sun@xx.com&typeid=1
string postdata = string.Format("mobile={0}&content=您名下的学生:{1} 编号:{2},{3}在留学管家修改了邮箱地址,原邮箱为:{4} 新邮箱为:{5}&typeid=1", item.AdviserMobile, stuName, stuNo, DateTime.Now.ToString("yyyy-MM-dd"), email, value.Field); string result1 = JsonHelper.PushToWeb("http://xxxx:10086/SMSPush", postdata); //192.168.0.120
2.对应的pushtoweb方法
public static string PushToWeb(string weburl, string data) { byte[] byteArray = Encoding.UTF8.GetBytes(data); HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(new Uri(weburl)); webRequest.Method = "POST"; webRequest.ContentType = "application/x-www-form-urlencoded"; webRequest.ContentLength = byteArray.Length; Stream newStream = webRequest.GetRequestStream(); newStream.Write(byteArray, 0, byteArray.Length); newStream.Close(); //接收返回信息: HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse(); StreamReader aspx = new StreamReader(response.GetResponseStream(), Encoding.UTF8); return aspx.ReadToEnd(); }
0 0
- 发送短信
- 发送短信
- 发送短信
- 短信发送
- 发送短信
- 发送短信
- 短信发送。
- 发送短信
- 发送短信
- 短信发送
- 发送短信
- 短信发送
- 发送短信
- 短信发送
- 短信发送
- 短信发送
- 发送短信
- 发送短信
- 欢迎使用CSDN-markdown编辑器
- javabean设计原则
- OO
- 33 个 2017 年必须了解的 iOS 开源库
- 运维笔记27 (搭建高可用集群管理软件(HA套件),配置虚拟fence断电管理)
- 发送短信
- HDU1203 I NEED A OFFER!
- POJ 3637 Shopaholic 再想想
- 硬盘的读写原理
- 59. Spring Boot Validator校验【从零开始学Spring Boot】
- 编译器编译过程
- android wpa_supplicant 调试
- 关于xib的一些东西 xib中多个控件如何让他们平分屏幕的宽度(转载的)
- Ubuntu 安装Samba(Linux与Windows共享文件)