Ejemplo n.º 1
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="REFRESH_TOKEN"></param>
        /// <param name="OPENID"></param>
        /// <returns></returns>
        public OAuthUser Get_UserInfo1(string access_token, string openid)
        {
            string    url             = "https://api.weixin.qq.com/sns/userinfo?access_token=" + access_token + "&openid=" + openid + "";
            string    str             = GetJson(url);
            OAuthUser OAuthUser_Model = SerializeUtility.JavaScriptDeserialize <OAuthUser>(str);

            return(OAuthUser_Model);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取授权token
        /// </summary>
        /// <param name="Code"></param>
        /// <returns></returns>
        public OAuth_Token Get_token1(string Code)
        {
            string      url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + ConfigSetting.WeiXinAppID + "&secret=" + ConfigSetting.WeiXinAppSecret + "&code=" + Code + "&grant_type=authorization_code ";
            string      str = GetJson(url);
            OAuth_Token Oauth_Token_Model = SerializeUtility.JavaScriptDeserialize <OAuth_Token>(str);

            return(Oauth_Token_Model);
        }