Пример #1
0
        //
        // GET: /WeiXin/

        /// <summary>
        /// 回调URL
        /// </summary>
        /// <returns></returns>
        public ActionResult VerifyURL(string msg_signature, string timestamp, string nonce, string echostr)
        {
            if (Request.HttpMethod == "GET")
            {
                return(Content(new MessageAPI(msg_signature, timestamp, nonce).ReplyVerify(echostr)));
            }
            else
            {
                try
                {
                    MessageAPI messageAPI = new MessageAPI(new HttpReceive(Request));

                    WeiXinHelper wxHelper = new WeiXinHelper(messageAPI);

                    return(ReciveMessage(messageAPI, wxHelper));
                }
                catch (Exception ex)
                {
                    BaseAPI.Log(ex.Source + ":" + ex.Message);
                    return(Content(""));
                }
            }
        }
Пример #2
0
 /// <summary>
 /// 获取微信返回消息后,需要自行实现逻辑
 /// </summary>
 public abstract ContentResult ReciveMessage(MessageAPI messageAPI, WeiXinHelper wxHelper);