MpWeiXinCore 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package MpWeiXinCore --version 1.0.0                
NuGet\Install-Package MpWeiXinCore -Version 1.0.0                
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="MpWeiXinCore" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MpWeiXinCore --version 1.0.0                
#r "nuget: MpWeiXinCore, 1.0.0"                
#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.
// Install MpWeiXinCore as a Cake Addin
#addin nuget:?package=MpWeiXinCore&version=1.0.0

// Install MpWeiXinCore as a Cake Tool
#tool nuget:?package=MpWeiXinCore&version=1.0.0                

微信公众号开发

使用

使用前先注入IDistributedCache

// 分布式 Redis 缓存
services.AddStackExchangeRedisCache(options =>
{
    options.Configuration = "localhost";
    options.InstanceName = "SampleInstance";
});

注入服务

services.AddMpWeiXin(option =>
{
    configuration.GetSection("WxConfig").Bind(option);
});

or

services.AddMpWeiXin(option =>
{
    AppId ="wxxxxx";
    AppSecret = "test";
});

功能

验证签名

WeiXinSignature.ValidateSignature()

获取TOKEN

WxAccessTokenService.GetToken()

生成临时二维码

WxAccountService.GetQrCode(int sceneId)
  • screen: 生成二维码的场景

发送客服消息

CustomerService.Send(CustomerMessage message)
  • message: 客户消息对象

微信服务器事件推送处理

  1. 自定义菜单事件
  2. 微信推荐事件

微信js sdk

  1. 获取微信分享朋友圈、分享给朋友权限验证配置
WxJsSdkService.GetSignature

配置

在appsettings中加入以下内容

"WxConfig": {
  // 配置当前是否开启调试,`1:开启,0:禁用`
  "IsDebug": true,
  // 开发阶段使用的TOKEN
  "AccessToken": "",
  "AppId": "wx725d7d9a9fcf63a6",
  "AppSecret": "9571cc24f82834b9d7314fa2ffa79db6",
  "Token": "CHNFUND_VST"
}
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. 
.NET Core netcoreapp3.1 is compatible. 
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.4 388 11/23/2022
1.0.3 334 11/22/2022
1.0.2 632 1/18/2022
1.0.1 619 8/4/2020
1.0.0 530 7/8/2020