FayElf.Plugins.WeChat 1.0.5

dotnet add package FayElf.Plugins.WeChat --version 1.0.5                
NuGet\Install-Package FayElf.Plugins.WeChat -Version 1.0.5                
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="FayElf.Plugins.WeChat" Version="1.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FayElf.Plugins.WeChat --version 1.0.5                
#r "nuget: FayElf.Plugins.WeChat, 1.0.5"                
#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 FayElf.Plugins.WeChat as a Cake Addin
#addin nuget:?package=FayElf.Plugins.WeChat&version=1.0.5

// Install FayElf.Plugins.WeChat as a Cake Tool
#tool nuget:?package=FayElf.Plugins.WeChat&version=1.0.5                

FayElf.Plugins.WeChat

fayelf

GitHub top language GitHub License Nuget Downloads Nuget Nuget (with prereleases)

Nuget:XiaoFeng

QQ群号 QQ群 公众号
748408911 QQ 群 畅聊了个科技

源码: https://github.com/zhuovi/FayElf.Plugins.WeChat

教程: https://www.yuque.com/fayelf/xiaofeng

包含了微信公众号,小程序接口

FayElf.Plugins.WeChat

XiaoFeng generator with XiaoFeng.

Install

.NET CLI

$ dotnet add package FayElf.Plugins.WeChat --version 1.0.5

Package Manager

PM> Install-Package FayElf.Plugins.WeChat -Version 1.0.5

PackageReference

<PackageReference Include="FayElf.Plugins.WeChat" Version="1.0.5" />

Paket CLI

> paket add FayElf.Plugins.WeChat --version 1.0.5

Script & Interactive

> #r "nuget: FayElf.Plugins.WeChat, 1.0.5"

Cake

// Install XiaoFeng as a Cake Addin
#addin nuget:?package=FayElf.Plugins.WeChat&version=1.0.5

// Install XiaoFeng as a Cake Tool
#tool nuget:?package=FayElf.Plugins.WeChat&version=1.0.5

更新日志

2023-10-27 v 1.0.5

1.优化部分功能;

2.增加readme.md实例;

XiaoFeng 类库包含库

命名空间 所属类库 开源状态 说明 包含功能
XiaoFeng.Prototype XiaoFeng.Core 扩展库 ToCase 类型转换<br/>ToTimestamp,ToTimestamps 时间转时间戳<br/>GetBasePath 获取文件绝对路径,支持Linux,Windows<br/>GetFileName 获取文件名称<br/>GetMatch,GetMatches,GetMatchs,IsMatch,ReplacePatten,RemovePattern 正则表达式操作<br/>
XiaoFeng.Net XiaoFeng.Net 网络库 XiaoFeng网络库,封装了Socket客户端,服务端(Socket,WebSocket),根据当前库可轻松实现订阅,发布等功能。
XiaoFeng.Http XiaoFeng.Core 模拟请求库 模拟网络请求
XiaoFeng.Data XiaoFeng.Core 数据库操作库 支持SQLSERVER,MYSQL,ORACLE,达梦,SQLITE,ACCESS,OLEDB,ODBC等数十种数据库
XiaoFeng.Cache XiaoFeng.Core 缓存库 内存缓存,Redis,MemcachedCache,MemoryCache,FileCache缓存
XiaoFeng.Config XiaoFeng.Core 配置文件库 通过创建模型自动生成配置文件,可为xml,json,ini文件格式
XiaoFeng.Cryptography XiaoFeng.Core 加密算法库 AES,DES,RSA,MD5,DES3,SHA,HMAC,RC4加密算法
XiaoFeng.Excel XiaoFeng.Excel Excel操作库 Excel操作,创建excel,编辑excel,读取excel内容,边框,字体,样式等功能
XiaoFeng.Ftp XiaoFeng.Ftp FTP请求库 FTP客户端
XiaoFeng.IO XiaoFeng.Core 文件操作库 文件读写操作
XiaoFeng.Json XiaoFeng.Core Json序列化,反序列化库 Json序列化,反序列化库
XiaoFeng.Xml XiaoFeng.Core Xml序列化,反序列化库 Xml序列化,反序列化库
XiaoFeng.Log XiaoFeng.Core 日志库 写日志文件,数据库
XiaoFeng.Memcached XiaoFeng.Memcached Memcached缓存库 Memcached中间件,支持.NET框架、.NET内核和.NET标准库,一种非常方便操作的客户端工具。实现了Set,Add,Replace,PrePend,Append,Cas,Get,Gets,Gat,Gats,Delete,Touch,Stats,Stats Items,Stats Slabs,Stats Sizes,Flush_All,Increment,Decrement,线程池功能。
XiaoFeng.Redis XiaoFeng.Redis Redis缓存库 Redis中间件,支持.NET框架、.NET内核和.NET标准库,一种非常方便操作的客户端工具。实现了Hash,Key,String,ZSet,Stream,Log,List,订阅发布,线程池功能;
XiaoFeng.Threading XiaoFeng.Core 线程库 线程任务,线程队列
XiaoFeng.Mvc XiaoFeng.Mvc 低代码WEB开发框架 .net core 基础类,快速开发CMS框架,真正的低代码平台,自带角色权限,WebAPI平台,后台管理,可托管到服务运行命令为:应用.exe install 服务名 服务说明,命令还有 delete 删除 start 启动 stop 停止。
XiaoFeng.Proxy XiaoFeng.Proxy 代理库 开发中
XiaoFeng.TDengine XiaoFeng.TDengine TDengine 客户端 开发中
XiaoFeng.GB28181 XiaoFeng.GB28181 视频监控库,SIP类库,GB28181协议 开发中
XiaoFeng.Onvif XiaoFeng.Onvif 视频监控库Onvif协议 XiaoFeng.Onvif 基于.NET平台使用C#封装Onvif常用接口、设备、媒体、云台等功能, 拒绝WCF服务引用动态代理生成wsdl类文件 , 使用原生XML扩展标记语言封装参数,所有的数据流向都可控。
FayElf.Plugins.WeChat FayElf.Plugins.WeChat 微信公众号,小程序类库 微信公众号,小程序类库。
XiaoFeng.Mqtt XiaoFeng.Mqtt MQTT协议 XiaoFeng.Mqtt中间件,支持.NET框架、.NET内核和.NET标准库,一种非常方便操作的客户端工具。实现了MQTT客户端,MQTT服务端,同时支持TCP,WebSocket连接。支持协议版本3.0.0,3.1.0,5.0.0。

FayElf.Plugins.WeChat 用法实例

微信公众号
var receive = new FayElf.Plugins.WeChat.OfficialAccount.Receive();
var msg = receive.RequestMessage(this.Request, (message, xValue) =>
{
    //message 是收到的结构消息
    //xvalue 是xml结构数据
    if (message.IsNullOrEmpty()) return "error";
    if (message.Event == FayElf.Plugins.WeChat.EventType.subscribe)
    {
        //订阅事件
    }
    else if (message.Event == FayElf.Plugins.WeChat.EventType.unsubscribe)
    {
        //取消订阅事件
    }
    if (message.MsgType == Plugins.WeChat.MessageType.text)
    {
        //接收回复消息
    }
    return string.Empty;
});
if (this.Request.Method == HttpMethod.Get.ToString())
{
    if (msg == "error") return Content("error");
    else return Content(msg);
}
return Content(msg);
微信小程序

JsSDK
var sign = new FayElf.Plugins.WeChat.JSSDK().GetSignature(XiaoFeng.Mvc.Web.HttpContext.Current.Request.GetUri().ToString());
//sign模型
/// <summary>
    /// 签名模型
    /// </summary>
    public class SignatureModel
    {
        #region 构造器
        /// <summary>
        /// 无参构造器
        /// </summary>
        public SignatureModel()
        {

        }
        #endregion

        #region 属性
        /// <summary>
        /// 应用ID
        /// </summary>
        public string AppId { get; set; }
        /// <summary>
        /// Noice字符串
        /// </summary>
        public string NonceString { get; set; }
        /// <summary>
        /// 时间戳
        /// </summary>
        public int Timestamp { get; set; }
        /// <summary>
        /// 原始字符串
        /// </summary>
        public string RawString { get; set; }
        /// <summary>
        /// 签名
        /// </summary>
        public string Signature { get; set; }
        #endregion

        #region 方法

        #endregion
    }

作者介绍

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  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. 
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.5 273 10/27/2023
1.0.4 205 4/4/2023
1.0.3 244 5/23/2022

修复.net7与HttpMethod冲突;优化部分功能;增加readme.md实例