38 Star 45 Fork 39

lucky7 / WeiXinSDK

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
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;
        }
    }
}

Empty file

About

微信SDK expand collapse
C#
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
C#
1
https://gitee.com/loogn/WeiXinSDK.git
git@gitee.com:loogn/WeiXinSDK.git
loogn
WeiXinSDK
WeiXinSDK
master

Search