微信请求中ToUserName包含的信息
Exemplo n.º 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;
 }
Exemplo n.º 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);
        }