排名
6
文章
6
粉丝
16
评论
8
{{item.articleTitle}}
{{item.blogName}} : {{item.content}}
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256
50010702506256
欢迎加群交流技术
分类:
.NET
先要去开通短信服务

然后去添加签名和模板
发送短信的时候需要

然后就是需要充值了
主要有两种计费方式,一种是包年,比如下面这种2年5000条180,。哈哈哈其实就是一件T恤或者一个皮肤的价格就可以玩2年了还是不算贵

或者你可以选择按需付费就是发送多少条就花多少钱,在前期短信消耗很少的时候可以用这种方式。
这种方式不需要购买,保证你的账户上面有钱即可。

比如我账号这里有10块钱,哈哈哈
为什么只有10块钱....
然后这些都搞定了就可以发送短信了
在快速学习里边有个api Demo

里边有各种语言的demo安装这个写就行了还是很简单

贴一下c#调用的代码:
using System;
using System.Collections.Generic;
using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Profile;
using Aliyun.Acs.Core.Exceptions;
using Aliyun.Acs.Core.Http;
namespace CommonRequestDemo
{
class Program
{
static void Main(string[] args)
{
IClientProfile profile = DefaultProfile.GetProfile("cn-hangzhou", "<accessKeyId>", "<accessSecret>");
DefaultAcsClient client = new DefaultAcsClient(profile);
CommonRequest request = new CommonRequest();
request.Method = MethodType.POST;
request.Domain = "dysmsapi.aliyuncs.com";
request.Version = "2017-05-25";
request.Action = "SendSms";
// request.Protocol = ProtocolType.HTTP;
request.AddQueryParameters("PhoneNumbers", "需要发送的电话号码");
request.AddQueryParameters("SignName", "TNBLOG");
request.AddQueryParameters("TemplateCode", "申请的模块code");
request.AddQueryParameters("TemplateParam", "{\"code\":\"短信内容\"}");
try {
CommonResponse response = client.GetCommonResponse(request);
Console.WriteLine(System.Text.Encoding.Default.GetString(response.HttpResponse.Content));
}
catch (ServerException e)
{
Console.WriteLine(e);
}
catch (ClientException e)
{
Console.WriteLine(e);
}
}
}
}其中accessKeyId和accessSecret需要自己去申请一下

需要的sdk版本下载地址:https://develop.aliyun.com/tools/sdk?spm=a2c4g.11186623.2.15.617e3854cp97wA#/dotnet

欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739。有需要软件开发,或者学习软件技术的朋友可以和我联系~(Q:815170684)
评价