MYDev.FbyunSms 1.0.0-preview.3

This is a prerelease version of MYDev.FbyunSms.
dotnet add package MYDev.FbyunSms --version 1.0.0-preview.3
                    
NuGet\Install-Package MYDev.FbyunSms -Version 1.0.0-preview.3
                    
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="MYDev.FbyunSms" Version="1.0.0-preview.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MYDev.FbyunSms" Version="1.0.0-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="MYDev.FbyunSms" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MYDev.FbyunSms --version 1.0.0-preview.3
                    
#r "nuget: MYDev.FbyunSms, 1.0.0-preview.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MYDev.FbyunSms@1.0.0-preview.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MYDev.FbyunSms&version=1.0.0-preview.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=MYDev.FbyunSms&version=1.0.0-preview.3&prerelease
                    
Install as a Cake Tool

MYDev.FbyunSms 非比云短信 SDK

NuGet NuGet Downloads

.NET SDK for 非比云短信服务,提供企业级短信发送解决方案。

功能特性

  • 完整的非比云短信 API 接口封装
  • 基于 .NET Standard 2.0 构建,支持跨平台
  • 集成依赖注入扩展
  • 支持定时发送、扩展码等高级功能
  • 简洁易用的 API 设计

配置

appsettings.json 中添加配置:

{
  "FbyunSms": {
    "UserId": "your-user-id",
    "UserName": "your-username",
    "Password": "your-password",
    "Subject": "【您的签名】"
  }
}

Startup.csProgram.cs 中注册服务:

// 注册服务
services.AddFbyunSms();

// 配置选项
services.Configure<FbyunSmsOptions>(configuration.GetSection("FbyunSms"));

核心概念

  • 短信发送:支持普通短信发送、定时发送等功能
  • 签名管理:自动处理短信签名
  • 参数配置:灵活配置账号信息和发送选项

API 请求列表

短信发送 (Send)

请求类 接口说明 端点
FbyunSmsRequests.SendRequest 发送短信 /v2sms.aspx

使用示例

发送短信

var message = new SmsMessage
{
    PhoneNumber = "13800138000",
    Text = "您的验证码是:123456"
};

await smsSender.SendAsync(message);

发送定时短信

var message = new SmsMessage
{
    PhoneNumber = "13800138000",
    Text = "您的验证码是:123456"
};

message.Properties["SendTime"] = DateTime.Now.AddHours(1); // 1小时后发送

await smsSender.SendAsync(message);

发送带扩展码的短信

var message = new SmsMessage
{
    PhoneNumber = "13800138000",
    Text = "您的验证码是:123456"
};

message.Properties["ExtNo"] = "0001"; // 扩展码

await smsSender.SendAsync(message);

异常处理

所有 API 错误都会抛出相应的异常,可以通过标准的 .NET 异常处理机制捕获和处理。

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
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.0-preview.3 146 12/4/2025
1.0.0-preview.2 615 12/2/2025
1.0.0-preview.1 134 11/27/2025