Ejemplo n.º 1
0
        public static BaseMessage Load(EnterParam param, bool bug = true)
        {
            string postStr = "";
            Stream s       = VqiRequest.GetInputStream();//此方法是对System.Web.HttpContext.Current.Request.InputStream的封装,可直接代码

            byte[] b = new byte[s.Length];
            s.Read(b, 0, (int)s.Length);
            postStr = Encoding.UTF8.GetString(b);//获取微信服务器推送过来的字符串
            var    timestamp     = VqiRequest.GetQueryString("timestamp");
            var    nonce         = VqiRequest.GetQueryString("nonce");
            var    msg_signature = VqiRequest.GetQueryString("msg_signature");
            var    encrypt_type  = VqiRequest.GetQueryString("encrypt_type");
            string data          = "";

            if (encrypt_type == "aes")//加密模式处理
            {
                //param.IsAes = true;
                //var ret = new MsgCrypt(param.token, param.EncodingAESKey, param.appid);
                //int r = ret.DecryptMsg(msg_signature, timestamp, nonce, postStr, ref data);
                //if (r != 0)
                //{
                //    wxPlatForm.Base.WriteBug("消息解密失败");
                //    return null;

                //}
            }
            else
            {
                param.IsAes = false;
                data        = postStr;
            }
            if (bug)
            {
                Utils.WriteTxt(data);
            }
            return(MessageFactory.CreateMessage(data));
        }
Ejemplo n.º 2
0
 public static void ResVideo(EnterParam param, Video v)
 {
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 回复消息(音乐)
 /// </summary>
 public static void ResMusic(EnterParam param, Music mu)
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 回复消息(图片)
 /// </summary>
 public static void ResPicture(EnterParam param, Picture pic, string domain)
 {
 }