微信请求中ToUserName包含的信息
示例#1
0
 /// <summary>
 /// 获取RequestMessage中ToUserName中的信息(这条信息由微微嗨平台向APP发出)
 /// </summary>
 /// <param name="toUserName">RequestMessage中的ToUserName属性</param>
 /// <returns></returns>
 public static WeixinRequestInfo GetWeixinRequestInfo(string toUserName)
 {
     var info = new WeixinRequestInfo();
     try
     {
         var data = toUserName.Split('_');
         info.WeixinId = int.Parse(data[1]);
         info.AppId = int.Parse(data[2]);
     }
     catch
     {
     }
     return info;
 }
示例#2
0
        /// <summary>
        /// 获取RequestMessage中ToUserName中的信息(这条信息由微微嗨平台向APP发出)
        /// </summary>
        /// <param name="toUserName">RequestMessage中的ToUserName属性</param>
        /// <returns></returns>
        public static WeixinRequestInfo GetWeixinRequestInfo(string toUserName)
        {
            var info = new WeixinRequestInfo();

            try
            {
                var data = toUserName.Split('_');
                info.WeixinId = int.Parse(data[1]);
                info.AppId    = int.Parse(data[2]);
            }
            catch
            {
            }
            return(info);
        }