Exemplo n.º 1
0
        /// <summary>
        /// 处理请求
        /// </summary>
        private void Execute(string postString)
        {
            //日志记录微信请求数据
            log.Info("请求消息内容:" + postString);
            string response = new WeixinApiDispatch().Dispatch(postString);

            //日志记录响应微信请求数据内容
            log.Info("回复消息内容:" + response);
            HttpContext.Current.Response.ContentEncoding = Encoding.UTF8;
            HttpContext.Current.Response.Write(response);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 业务处理
        /// </summary>
        /// <param name="postString"></param>
        private void Execute(string postString)
        {
            //1.检验access_token
            new GetIp_list().Execute("wx");
            TracingHelper.Info("检验wxaccess_token完毕");
            //2.业务处理
            WeixinApiDispatch dispatch        = new WeixinApiDispatch();
            string            responseContent = dispatch.Execute(postString);

            TracingHelper.Info("业务处理完毕  " + responseContent);
            //3.返回微信服务器

            HttpContext.Current.Response.ContentEncoding = Encoding.UTF8;
            HttpContext.Current.Response.Write(responseContent);
        }