分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 技术分享

创蓝语音服务(语音通知验证码).net

发布时间:2023-09-06 02:13责任编辑:胡小海关键词:验证码
 ?public static string PostUrl = "http://zapi.253.com/msg/HttpBatchSendSM"; ???????static void Main(string[] args) ???????{ ???????????string account = ""; ???????????string password = ""; ???????????string mobile = "1"; ???????????string content = "您的登陆验证码是1234"; ???????????string postStrTpl = "account={0}&pswd={1}&mobile={2}&msg={3}&needstatus=true&product=&extno="; ???????????UTF8Encoding encoding = new UTF8Encoding(); ???????????byte[] postData = encoding.GetBytes(string.Format(postStrTpl, account, password, mobile, content)); ???????????HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(PostUrl); ???????????myRequest.Method = "POST"; ???????????myRequest.ContentType = "application/x-www-form-urlencoded"; ???????????myRequest.ContentLength = postData.Length; ???????????Stream newStream = myRequest.GetRequestStream(); ???????????// Send the data. ???????????newStream.Write(postData, 0, postData.Length); ???????????newStream.Flush(); ???????????newStream.Close(); ???????????HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); ???????????if (myResponse.StatusCode == HttpStatusCode.OK) ???????????{ ???????????????StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8); ???????????????myResponse.Close(); ???????????????myRequest.Abort(); ???????????????Console.WriteLine("发送成功"); ???????????????Console.ReadKey(); ???????????} ???????????else ???????????{ ???????????????myRequest.Abort(); ???????????????myResponse.Close(); ???????????????Console.WriteLine("发送失败"); ???????????????Console.ReadKey(); ???????????} ???????}

创蓝语音服务.net

创蓝语音服务(语音通知验证码).net

原文地址:https://www.cnblogs.com/yechangzhong-826217795/p/9597537.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved