MYDev.NinetyFiveYtxSms
1.0.0-preview.3
.NET 10.0
This package targets .NET 10.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
This is a prerelease version of MYDev.NinetyFiveYtxSms.
dotnet add package MYDev.NinetyFiveYtxSms --version 1.0.0-preview.3
NuGet\Install-Package MYDev.NinetyFiveYtxSms -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.NinetyFiveYtxSms" 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.NinetyFiveYtxSms" Version="1.0.0-preview.3" />
<PackageReference Include="MYDev.NinetyFiveYtxSms" />
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.NinetyFiveYtxSms --version 1.0.0-preview.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MYDev.NinetyFiveYtxSms, 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.NinetyFiveYtxSms@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.NinetyFiveYtxSms&version=1.0.0-preview.3&prerelease
#tool nuget:?package=MYDev.NinetyFiveYtxSms&version=1.0.0-preview.3&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MYDev.NinetyFiveYtxSms 95云通讯短信 SDK
.NET SDK for 95云通讯短信服务,提供企业级短信发送解决方案。
功能特性
- 完整的95云通讯短信 API 接口封装
- 基于 .NET Standard 2.0 构建,支持跨平台
- 支持调试模式(测试环境)
- 集成依赖注入扩展
- 异常处理与错误信息封装
- 支持短信发送、余额查询等核心功能
配置
在 appsettings.json 中添加配置:
{
"NinetyFiveYtxSms": {
"EnterpriseId": "your-enterprise-id",
"UserName": "your-username",
"Password": "your-password",
"Subject": "your-signature",
"IsDebug": false
}
}
在 Startup.cs 或 Program.cs 中注册服务:
// 注册服务
services.AddNinetyFiveYtxSms();
// 配置选项
services.Configure<NinetyFiveYtxSmsOptions>(configuration.GetSection("NinetyFiveYtxSms"));
核心概念
- 短信发送:支持单条或多条短信发送
- 余额查询:查询账户剩余短信条数
- 签名管理:自动处理短信签名
API 请求列表
短信发送 (Send)
| 请求类 | 接口说明 | 端点 |
|---|---|---|
| SendRequest | 发送短信 | /mxt/send |
余额查询 (Balance Query)
| 请求类 | 接口说明 | 端点 |
|---|---|---|
| BalanceQueryRequest | 查询账户余额 | /mxt/getfee |
使用示例
发送短信
var model = new NinetyFiveYtxSmsRequests.SendModel
{
Phone = "13800138000",
Message = "您的验证码是:123456"
};
var request = NinetyFiveYtxSmsRequests.ToSend(model);
var response = await sender.SendAsync(request, ninetyFiveYtxSmsOptions);
查询余额
var request = NinetyFiveYtxSmsRequests.ToBalanceQuery();
var response = await sender.SendAsync(request, ninetyFiveYtxSmsOptions);
if (response.IsSucceed)
{
Console.WriteLine($"当前余额:{response.Balance} 条");
}
异常处理
所有 API 错误都会抛出标准异常,可以通过捕获异常来处理错误情况。
| Product | Versions 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.
-
.NETStandard 2.0
- Sparkdo.Core (>= 1.0.1)
- Sparkdo.Sdks.Abstractions (>= 1.0.1)
- Sparkdo.Sms (>= 1.0.1)
-
net10.0
- Sparkdo.Core (>= 1.0.1)
- Sparkdo.Sdks.Abstractions (>= 1.0.1)
- Sparkdo.Sms (>= 1.0.1)
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 | 150 | 12/4/2025 |
| 1.0.0-preview.2 | 621 | 12/2/2025 |
| 1.0.0-preview.1 | 130 | 11/27/2025 |