Awesome Open Source
Awesome Open Source

Senparc.Weixin .NET SDK

Build status NuGet GitHub commit activity the past week, 4 weeks, year license

[English Version]

Senparc.WeixinJS-SDK/ Demo .NET

Senparc.Weixin
.NET 3.5 / 4.0 / 4.5 / .NET Standard 2.x / .NET Core 2.x / .NET Core 3.x / .NET 6.0 MVCRazorWebApiConsole.exeBlazorMAUI

Senparc.Weixin SDK .NET SDK .NET

2013 9

Star )

Sample .NET 7.0
V3

Hello World 3


[`/Samples/MP/`](/Samples/MP/)

/Samples/ Sample /Samples/All/ Sample

2

Program.cs builder.Build()

builder.Services.AddSenparcWeixinServices(builder.Configuration);

Startup.cs ConfigureServices()

Program.cs builder.Build()

var registerService = app.UseSenparcWeixin(app.Environment, null, null, register => { },
    (register, weixinSetting) =>
{
    //
    register.RegisterMpAccount(weixinSetting, "");
});

Startup.cs Configure()

1

await Senparc.Weixin.MP.AdvancedAPIs.CustomApi.SendTextAsync("AppId", "OpenId", "Hello World!");

1. Senparc.Weixin SDK AccessToken AppId AccessToken
2. AppId `Senparc.Weixin.Config.SenparcWeixinSetting` `appsettings.json` 3. Senparc.Weixin.MP.AdvancedAPIs.CustomApi.SendText() 4. API bug

MessageHandler

CustomMessageHandler.cs
using Senparc.NeuChar.Entities;
using Senparc.Weixin.MP.Entities;
using Senparc.Weixin.MP.Entities.Request;
using Senparc.Weixin.MP.MessageContexts;
using Senparc.Weixin.MP.MessageHandlers;

namespace Senparc.Weixin.Sample.MP
{
    /// <summary>
    /// MessageHandler
    /// MessageHandler
    /// </summary>
    public partial class CustomMessageHandler : MessageHandler<DefaultMpMessageContext>
    {
        public CustomMessageHandler(Stream inputStream, PostModel postModel, int maxRecordCount = 0,
            bool onlyAllowEncryptMessage = false, IServiceProvider serviceProvider = null)
            : base(inputStream, postModel, maxRecordCount, onlyAllowEncryptMessage, null, serviceProvider)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override IResponseMessageBase DefaultResponseMessage(IRequestMessageBase requestMessage)
        {
            //ResponseMessageTextNews
            var responseMessage = this.CreateResponseMessage<ResponseMessageText>();
            responseMessage.Content = $"";
            return responseMessage;
        }

        public override Task<IResponseMessageBase> OnImageRequestAsync(RequestMessageImage requestMessage)
        {
            //...
        }

        public override Task<IResponseMessageBase> OnLocationRequestAsync(RequestMessageLocation requestMessage)
        {
            //...
        }
    }
}

CustomMessageHandler

`` ControllerWebApi CustomMessageHandler Program.cs MessageHandler

app.UseMessageHandlerForMp("/WeixinAsync",
    (stream, postModel, maxRecordCount, serviceProvider)
        => new CustomMessageHandler(stream, postModel, maxRecordCount, false, serviceProvider),
    options 
        =>
    {
        options.AccountSettingFunc = context => Senparc.Weixin.Config.SenparcWeixinSetting;
    });

https://YourDomain/WeixinAsync >> (URL) Token appsettings.json Sample

Controller WebApi .NET Framework

.NET Framework/.NET Standard 2.0/.NET Core/.NET 6

# DLL Nuget .NET
1 Senparc.Weixin.dll Senparc.Weixin
Senparc.Weixin
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0
2 /
JSSDK /
Senparc.Weixin.MP.dll MP
MP
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0
3

Senparc.Weixin.WxOpen.dll WxOpen
WxOpen
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0
4 Senparc.Weixin.TenPay.dll TenPay
TenPay
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0
5 V3 Senparc.Weixin.TenPayV3.dll TenPayV3
TenPay
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0
6 ASP.NET MVC
Senparc.Weixin.MP.MVC.dll MP.MVC
Mvc
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0
7 Senparc.Weixin.QY.dll QY
QY
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0
9 Senparc.Weixin.Work.dll Work
Work
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0
9 Senparc.Weixin.Open.dll Open
Open
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0
10 Redis Senparc.Weixin.Cache.
Redis.dll
Cache.Redis
Redis
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0
11 Memcached
Senparc.Weixin.Cache.
Memcached.dll
Cache.Memcached
MC
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0
12 WebSocket
Senparc.WebSocket.dll Senparc.WebSocket
WebSocket
.NET 4.5 .NET Standard 2.0/2.1 .NET Core .NET 5.0 / 6.0

.NET 4.6 .NET Standard 2.x .NET Core .NET 5.0 / 6.0
.NET Framework 4.6.2 .NET Standard 2.0 / 2.1 .NET Core 2.x / 3.x .NET 5.0 / .NET 6.0 / .NET 7.0

1. 2019 5 1 .NET Framework 3.5 4.0 .NET Framework 3.5 + 4.0 [](https://github.com/JeffreySu/WeiXinMPSDK/releases/tag/v16.6.15)
2. 2022 4 3 .NET Framework 4.5 4.6.2 .NET Framework 4.5 [](https://github.com/JeffreySu/WeiXinMPSDK/releases/tag/v16.17.9)

  • 8.x API/
  • Session
  • V2/V3 API
  • RedisMemcached
  1. API dll Nuget
  2. Senparc.Weixin.Sample.Net6.sln Senparc.Weixin.Sample.Net7.sln Release Nuget /src/BuildOutPut/

src

Senparc.WebSocket WebSocket
Senparc.Weixin.Cache Senparc.Weixin.Cache.Memcached.dll Senparc.Weixin.Cache.Redis.dll
Senparc.Weixin.AspNet Senparc.Weixin.AspNet.dll Web
Senparc.Weixin.MP.MvcExtension Senparc.Weixin.MP.MvcExtension.dll MVC
Senparc.Weixin.MP Senparc.Weixin.MP.dll SDK
Senparc.Weixin.MP.Middleware Senparc.Weixin.MP.Middleware.dll
Senparc.Weixin.Open Senparc.Weixin.Open.dll SDK
Senparc.Weixin.TenPay Senparc.Weixin.TenPay.dll & Senparc.Weixin.TenPayV3.dll V2 V3
Senparc.Weixin.Work Senparc.Weixin.Work.dll SDK
Senparc.Weixin.Work.Middleware Senparc.Weixin.Work.Middleware.dll
Senparc.Weixin.WxOpen Senparc.Weixin.WxOpen.dll SDK
Senparc.Weixin.WxOpen.Middleware Senparc.Weixin.WxOpen.Middleware.dll
Senparc.Weixin Senparc.Weixin.[x].dll

Samples Samples

Senparc.Weixin SDK AccessToken ````

Sample .sln All

SDK
MP Nuget
TenPayV2 V1 V2 Nuget
TenPayV3 V3TenPay APIv3 Nuget
Work Nuget
WxOpen Nuget
Shared Sample
All
All/console Console Demo.NET Core Nuget
All/net45-mvc Demo.NET Framework 4.5 + ASP.NET MVC Nuget
All/net6-mvc Demo.NET 6.0 .NET 5.0 .NET Core
All/net7-mvc Demo.NET 7.0 .NET 5.06.0 .NET Core

Samples

  1. https://weixin.senparc.com/
  2. Demo .NET 7.0 .NET 6.0 .NET Corehttps://sdk.weixin.senparc.com/
  3. https://www.cnblogs.com/szw/p/weixin-course-index.html
  4. https://weixin.senparc.com/QA
  5. https://sdk.weixin.senparc.com/Menu
  6. https://sdk.weixin.senparc.com/SimulateTool
  7. https://sdk.weixin.senparc.com/Cache/Test
  8. chmhttps://sdk.weixin.senparc.com/Document
  9. https://awesomeopensource.com/project/JeffreySu/WeiXinMPSDK
  10. https://awesomeopensource.com/project/JeffreySu/WeixinResource
  11. https://book.weixin.senparc.com
  12. https://item.jd.com/12220004.html
  • QQ

5377815480
14588231256
10246860933
12108830388
16860626938
``
130031388522939583493342319110
`43722120926425898825`
`748294225481062302709539061281`
`115531985931318342413615289181996`

  • QQ498977166

Senparc

Jeffrey Su 2 BookHelper

BookVersion1

Senparc

.NET



60
A

SenparcRobot

BookHelper

ForkPull Request

  1. Fork
  2. (git checkout -b my-new-feature)
  3. (git commit -am 'Added some feature')
  4. git (git push origin my-new-feature)
  5. github git my-new-feature Pull Request Developer master

.NET Core

.NET Framework 3.5 / 4.0 / 4.5 / 4.6.2 .NET Core 2.0 + 2.1 / .NET 5.0 + 6.0 release
.NET Framework Demo /src/Samples/All/net45-mvc
.NET 7.0 .NET 5.06.0 .NET Core 3.1 Demo /Samples/All/net7-mvc


  1. Sample net7-mvc Sample Release Senaprc.Weixin SDK
  2. .NET 6.0 .NET 5.0 .NET Core 3.1 Demo /Samples/All/net6-mvc

Nuget

Nuget Nuget SDK

1) Azure App Service

App Service Microsoft Azure Web .NET Azure

2) FTP

Web FTP FileZilla Server FTP Samples Senparc.Weixin.Sample.Net7Senparc.Weixin.Sample.Net6 Senparc.Weixin.Sample.NetCore3 Azure App Service FTP

| |
|-----------|--------------- | master | | Developer | 1 Beta master
2 .NET 4.5 / .NET Core / .NET Core 2.0 Pull Request master | BookVersion1 | | DotNET-Core_MySQL | .NET Core Pomelo.EntityFrameworkCore.MySql | NET4.0 | .NET 4.0 2017.NET 4.0 master / Developer | NET3.5 | .NET 3.5 2015.NET 3.5 master / Developer | Developer-Senparc.SDK | Senparc

donate

Star

starcharts stargazers over time

License

Apache License Version 2.0

Copyright 2022 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 
except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the 
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
either express or implied. See the License for the specific language governing permissions 
and limitations under the License.

Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md

Alternatives To Weixinmpsdk
Select To Compare


Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
C Sharp (178,367
Sdk (32,798
Redis (24,265
Azure (18,093
Mvc (10,187
Wechat (4,273
Ftp (3,682
Memcached (3,225
Weixin (972
Net6 (198
Wechat Sdk (127
Weixin Sdk (127
Dotnet7 (66
Jssdk (42
Distributed Cache (37
Senparc (6
Officialaccounts (5
Tenpay (5