大块头微信消息

码农软件 · 软件分类 · 微信/微信小程序 · 2019-03-14 09:27:57

软件介绍

快速实现简单的微信消息,事件响应功能

使用示例:

1. 继承

DKT.WeiXinAPI.Message.* 或者 DKT.WeiXinAPI.Event.*

中需要的事件或者消息类型,override Reply()方法,返回消息进行逻辑实现。 

下面是一个订阅事件的逻辑片段

namespace DKT.WeiXin.Service
{
public class Welcome : DKT.WeiXinAPI.Event.Subscribe
{
public override MessageBody Reply()
{
//这里用户在触发订阅事件后,返回一个 Text类型的消息
//您也可以选择 WeiXinAPI.Message.News.Response 等消息类型
//具体在WeiXinAPI.Message命名空间查看
var m = new WeiXinAPI.Message.Text.Response() {
ToUserName = Context.FromUserName,
FromUserName = Context.ToUserName,
Content = "哟,少年郎,欢迎关注大块头哟。" };
//您也可以通过Context.WeiXinParameters["p"],来访问微信的请求参数 return m;
}
}
}

2. 将实现类注册到框架

DKT.WeiXinAPI.Handler.Register(typeof(DKT.WeiXin.Service.Welcome));

3. 在Controller或者ASPX来进行响应

if (Request.HttpMethod.Equals("POST")) {

//在控制器,或者ASPX页面获取消息进行响应

return new ContentResult() { Content =DKT.WeiXinAPI.Handler.GetMessage() };

}

本文地址:https://codercto.com/soft/d/1312.html

Probability and Computing: Randomization and Probabilistic Techn

Probability and Computing: Randomization and Probabilistic Techn

Michael Mitzenmacher、Eli Upfal / Cambridge University Press / 2017-7-3 / USD 62.23

Greatly expanded, this new edition requires only an elementary background in discrete mathematics and offers a comprehensive introduction to the role of randomization and probabilistic techniques in m......一起来看看 《Probability and Computing: Randomization and Probabilistic Techn》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具