Wilddog.SMS 1.0.2

.NET Framework 4.6
dotnet add package Wilddog.SMS --version 1.0.2
NuGet\Install-Package Wilddog.SMS -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Wilddog.SMS" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Wilddog.SMS --version 1.0.2
#r "nuget: Wilddog.SMS, 1.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Wilddog.SMS as a Cake Addin
#addin nuget:?package=Wilddog.SMS&version=1.0.2

// Install Wilddog.SMS as a Cake Tool
#tool nuget:?package=Wilddog.SMS&version=1.0.2

wilddog-sms

Wilddog SMS SDK for .Net platform

Getting started

环境依赖:

  1. .net > 4.6.0
  2. Newtonsoft.Json >= 10.0.3

安装:

PM> Install-Package Wilddog.SMS

OR

Visual Studio中通过nuget搜索Wilddog.SMS

初始化

using Wilddog.Sms;
using Wilddog.Sms.Http;

Client client = new Client("YOUR_APP_ID", "YOUR_SMS_KEY");

发送验证码短信

使用野狗生成验证码
SubmitResponse submitRsps = client.SendCode("PHONE_NUMBER", "TEMPLATE_ID");
if (submitRsps.Success)
{
    Console.WriteLine(submitRsps.ToString());
}
else
{
    Console.WriteLine(submitRsps.WilddogError.ToString());
}
使用自生成验证码
IList Params = new ArrayList();
Params.Add("123456");
SubmitResponse submitRsps = client.SendCode("PHONE_NUMBER", "TEMPLATE_ID", Params);
if (submitRsps.Success)
{
    Console.WriteLine(submitRsps.ToString());
}
else
{
    Console.WriteLine(submitRsps.WilddogError.ToString());
}

校验验证码

CheckCodeResponse checkCodeRsps = client.CheckCode("PHONE_NUMBER", code);
if (checkCodeRsps.Success)
{
    Console.WriteLine(checkCodeRsps.ToString());
}
else
{
    Console.WriteLine(checkCodeRsps.WilddogError.ToString());
}

发送通知短信

IList Params = new ArrayList();
Params.Add("PARAM1");
IList mobiles = new ArrayList();
mobiles.Add("PHONE_NUMBER");
SubmitResponse submitRsps = client.SendNotify(mobiles, "TEMPLATE_ID", Params);
if (submitRsps.Success)
{
    Console.WriteLine(submitRsps.ToString());
}
else
{
    Console.WriteLine(submitRsps.WilddogError.ToString());
}

查询发送状态

V1
StatusResponse statusRsps = client.QueryStatus(rrid);
if (statusRsps.Success)
{
    Console.WriteLine(statusRsps.ToString());
}
else
{
    Console.WriteLine(statusRsps.WilddogError.ToString());
}
V2
StatusResponse statusRsps = client.QueryStatus();
if (statusRsps.Success)
{
    Console.WriteLine(statusRsps.ToString());
}
else
{
    Console.WriteLine(statusRsps.WilddogError.ToString());
}

查询账户余额

BalanceResponse balanceResp = client.QueryBalance();
if (balanceResp.Success)
{
    Console.WriteLine(balanceResp.ToString());
}
else
{
    Console.WriteLine(balanceResp.WilddogError.ToString());
}
Product Versions
.NET Framework net46 net461 net462 net463 net47 net471 net472 net48
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 897 12/1/2017