1 Star 0 Fork 39

Sharper Shen / WeiXinSDK

forked from lucky7 / WeiXinSDK 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

weixinsdk

//作者联系方法:
//email:loogn_0707@126.com
//QQ群:153725186
//支付宝:loogn2012@gmail.com (开源免费,欢迎资助~)

微信公开帐号接口

public class WeiXinUrl : IHttpHandler
{
    static string token = "token";
    static string AppId = "AppId";
    static string AppSecret = "AppSecret";
    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        var signature = context.Request["signature"] ?? string.Empty;
        var timestamp = context.Request["timestamp"] ?? string.Empty;
        var nonce = context.Request["nonce"] ?? string.Empty;
        
        //var echostr = context.Request.QueryString["echostr"] ?? string.Empty;
        if (WeiXin.CheckSignature(signature, timestamp, nonce, token))
        {
            //context.Response.Write(echostr);
            var replyMsg = WeiXin.ReplyMsg().GetXML();
            context.Response.Write(replyMsg);
        }
        else
        {
            context.Response.Write("fuck you");
        }

    }

    static WeiXinUrl()
    {
        WeiXin.ConfigGlobalCredential(AppId, AppSecret);
        //消息通知事件
        WeiXin.OnReceiveMsgEvent += new WeiXin.ReceiveMsg(WeiXin_OnReceiveMsgEvent);
        
        WeiXin.RegisterMsgHandler<RecTextMsg>(msg =>
        {
            return new ReplyTextMsg { Content = "你说:" + msg.Content };
        });

        WeiXin.RegisterEventHandler<EventAttendMsg>(msg =>
        {
            return new ReplyTextMsg { Content = "谢谢关注!" };
        });
    }

    
    //消息通知事件处理处理程序
    static void WeiXin_OnReceiveMsgEvent(string xml,Dictionary<string, string> dict)
    {
        if (dict.ContainsKey("Event"))
        {
           

        }
        else if (dict.ContainsKey("MsgId"))
        {

          
        }
    }
    
    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
}

空文件

简介

微信SKD 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/shrpcn/WeiXinSDK.git
git@gitee.com:shrpcn/WeiXinSDK.git
shrpcn
WeiXinSDK
WeiXinSDK
master

搜索帮助