微信扫一扫
认证、签名模板审核结果通知
账号短信余额不足提醒
平台促销活动及最新资讯
秒赛为开发者提供了详细的API文档和代码示例,帮助开发者快速接入短信平台
//项目需要添加System.web引用
using
System;
using
System.Collections.Generic;
using
System.IO;
using
System.Linq;
using
System.Net;
using
System.Text;
using
System.Threading.Tasks;
using
System.Web;
namespace
Apis {
class
Program {
static
void
Main(
string
[] args) {
//账号
string
account =
"xxxxxxxxxxxxxxxxxxxxxxx"
;
//密码
string
pswd =
"xxxxxxxxxxxxxxxxxxxxxxx"
;
//修改为您要发送的手机号
string
mobile =
"xxxxxxxxxxxxxxxxxxxxxxx"
;
// 短信发送接口的http地址,请咨询客服
string
url =
"xxxxxxxxxxxxxxxxx"
;
// 发验短信调用示例
// 发送内容
string
msg =
"【秒赛科技】您的验证码是:1234"
;
string
data =
"account="
+ account +
"&pswd="
+ pswd +
"&mobile="
+ mobile +
"&msg="
+ msg +
"&needstatus=true"
;
HttpPost(url, data);
}
public
static
void
HttpPost(
string
Url,
string
postDataStr) {
byte
[] dataArray = Encoding.UTF8.GetBytes(postDataStr);
// Console.Write(Encoding.UTF8.GetString(dataArray));
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
request.Method =
"POST"
;
request.ContentType =
"application/x-www-form-urlencoded"
;
request.ContentLength = dataArray.Length;
//request.CookieContainer = cookie;
Stream dataStream = request.GetRequestStream();
dataStream.Write(dataArray, 0, dataArray.Length);
dataStream.Close();
try
{
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader =
new
StreamReader(response.GetResponseStream(), Encoding.UTF8);
String res = reader.ReadToEnd();
reader.Close();
Console.Write(
" Response Content: "
+ res +
" "
);
}
catch
(Exception e) {
Console.Write(e.Message + e.ToString());
}
}
}
}
认证、签名模板审核结果通知
账号短信余额不足提醒
平台促销活动及最新资讯