public static string PostUrl = "http://zapi.253.com/msg/HttpBatchSendSM";
static void Main(string[] args)
{
string account = "";
string password = "";
string mobile = "";
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, , 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(返回错误的情况)

  public static string PostUrl = "http://zapi.253.com/msg/HttpBatchSendSM";
static void Main(string[] args)
{
string account = "V0240532111";
string password = "pE3e8r60wM01c5111";
string mobile = "";
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));
string resultCode = "";
HttpWebRequest myRequest = null;
HttpWebResponse myResponse = null;
try
{
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, , postData.Length);
newStream.Flush();
newStream.Close(); myResponse = (HttpWebResponse)myRequest.GetResponse(); if (myResponse.StatusCode == HttpStatusCode.OK)
{
StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
string result = reader.ReadToEnd(); if (result != null)
{
string[] arr = result.Split(',');
resultCode = arr[];
}
}
}catch(Exception ex)
{
Console.Write(ex);
}
finally
{
if (myRequest != null)
{
myRequest.Abort();
}
if (myResponse != null)
{
myResponse.Close();
}
}
if (resultCode.StartsWith(""))
{
Console.WriteLine("发送成功");
Console.ReadKey();
}
else
{
Console.WriteLine("发送失败" + resultCode);
Console.ReadKey();
}
}

创蓝语音服务(语音通知验证码).net的更多相关文章

  1. C# 开发(创蓝253)手机短信验证码接口

    创蓝253: https://www.253.com/ #region 获取手机验证码(创蓝253) /// <summary> /// 获取手机验证码(创蓝253) /// </s ...

  2. python3调用阿里云语音服务

    步骤 1 创建阿里云账号,包括语音服务里的企业实名 为了访问语音服务,您需要有一个阿里云账号.如果没有,可首先按照如下步骤创建阿里云账号: 访问阿里云 官方网站,单击页面上的 免费注册 按钮. 按照屏 ...

  3. 3D语音天气球(源码分享)——在Unity中使用Android语音服务

    转载请注明本文出自大苞米的博客(http://blog.csdn.net/a396901990),谢谢支持! 开篇废话: 这个项目准备分四部分介绍: 一:创建可旋转的"3D球":3 ...

  4. java接入创蓝253短信验证码

    说明 项目是springboot框架 1.短信配置文件 包含验证码发送路径.用户名.密码 chuanglan.requesturl= chuanglan.account= chuanglan.pswd ...

  5. Java如何调取创蓝253短信验证码

    基于创蓝253短信服务平台的Java调用短信接口API package com.bcloud.msg.http; import java.io.ByteArrayOutputStream; impor ...

  6. 【认知服务 Azure Cognitive Service】使用认知服务的密钥无法访问语音服务[ErrorCode=AuthenticationFailure] (2020-08时的遇见的问题,2020-09月已解决)

    问题情形 根据微软认知服务的文档介绍,创建认知服务(Cognitive Service)后,可以调用微软的影像(计算机视觉,人脸),语言(LUIS, 文本分析,文本翻译),语音(文本转语音,语音转文本 ...

  7. Android讯飞语音云语音听写学习

    讯飞语音云语音听写学习         这几天两个舍友都买了iPhone 6S,玩起了"Hey, Siri",我依旧对我的Nexus 5喊着"OK,Google" ...

  8. UI进阶 科大讯飞(1) 语音听写(语音转换成文字)

    一.科大讯飞开放平台: http://www.xfyun.cn/ 注册.登录之后创建新应用. 因为本项目只实现了语音听写,所以在SDK下载中心勾选语音听写单项SDK就可以了 开发平台选择iOS,应用选 ...

  9. 2019 创蓝253java面试笔试题 (含面试题解析)

      本人5年开发经验.18年年底开始跑路找工作,在互联网寒冬下成功拿到阿里巴巴.今日头条.创蓝253等公司offer,岗位是Java后端开发,因为发展原因最终选择去了创蓝253,入职一年时间了,也成为 ...

随机推荐

  1. ElasticSearch 2 (3) - Breaking Changes

    ElasticSearch 2.1.1 (3) - Breaking Changes Search Changes search_type = scan Deprecated GET /my_ind ...

  2. beta 圆桌 3

    2018-12-16图片缺失,当日数据: 总工作量:24 已完成:5 剩余:19 031602111 傅海涛 1.今天进展 实时字幕的实现大概 2.存在问题 实时字幕存在不稳定和耗费资源 3.明天安排 ...

  3. linux 文件夹操作

    一.操作命令 1.创建文件夹 : mkdir 2.创建文件 : touch.vi 3.删除文件/文件夹:rm 删除文件夹的时候使用 -r可以循环删除子目录 4.移动文件/文件夹:mv 移动文件夹,使用 ...

  4. Torch,Tensorflow使用: Ubuntu14.04(x64)+ CUDA8.0 安装 Torch和Tensorflow

    系统配置: Ubuntu14.04(x64) CUDA8.0 cudnn-8.0-linux-x64-v5.1.tgz(Tensorflow依赖) Anaconda 1. Torch安装 Torch是 ...

  5. IntelliJ IDEA之如何提交代码到SVN服务器

    一.准备 参照<IntelliJ IDEA教程之如何配置SVN>这篇文章配置SVN插件.提交代码到SVN之前,记得要先创建版本库,请参照<<SVN如何建立版本库>> ...

  6. java学习三 小数默认为double

    前++,后++在独立运算时候 直接计算出值 当后加加和减减和其他代码在一行的时候先使用加加和减减之前的值, 如果不在同一行,后面的一行就会得到加加或减减后的值 &&是逻辑运算符,逻辑运 ...

  7. 实现AJAX的基本步骤

    实现AJAX的基本步骤 要完整实现一个AJAX异步调用和局部刷新,通常需要以下几个步骤: (1)创建XMLHttpRequest对象,也就是创建一个异步调用对象. (2)创建一个新的HTTP请求,并指 ...

  8. UVa 572 油田 (dfs)

    The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSu ...

  9. 利用scrapy_redis实现分布式爬虫

    介绍 Scrapy框架不支持分布式,所以需要将一些关键代码进行修改使之支持分布式.scrapy-redis相当于一个插件,用来替换scrapy中的一些模块,使得scrapy支持分布式.github地址 ...

  10. c++并发编程之原子操作的实现原理

    原子(atomic)本意是”不能被进一步分割的最小粒子”,而原子操作(atomic operation)意为”不可被中断的一个或一系列操作”. 处理器如何实现原子操作 (1) 使用总线锁保证原子性 如 ...