Esempio n. 1
0
        public static string RequestUserInfoPtl(this QzoneResourceSession session, string language = "zh_CN")
        {
            if (String.IsNullOrEmpty(session.AccessToken.Value) || String.IsNullOrEmpty(session.AppId) || String.IsNullOrEmpty(session.OpenId))
            {
                throw new ArgumentException(@"传递的设置有问题");
            }
            const string format = "https://graph.qq.com/user/get_user_info?access_token={0}&oauth_consumer_key={1}&openid={2}&format=json";
            var          url    = string.Format(format, session.AccessToken.Value, session.AppId, session.OpenId);

            return(url);
        }
Esempio n. 2
0
        public static string RequestOpenIdPtl(this QzoneResourceSession session)
        {
            if (String.IsNullOrEmpty(session.AccessToken.Value))
            {
                throw new ArgumentException(@"传递的设置有问题");
            }

            const string format = "https://graph.qq.com/oauth2.0/me?access_token={0}";
            var          url    = string.Format(format, session.AccessToken.Value);

            return(url);
        }
Esempio n. 3
0
        public void HandleError()
        {
            #region 触发WeiXin错误包
            //WxResourceSession   wxSession = new WxResourceSession(new HttpSuppplier(),new AccessToken("test")){OpenId = "test"};
            //wxSession.Request<WxUserInfoResult>(new Uri(wxSession.RequestUserInfoPtl()));
            #endregion

            #region 触发WeiBo错误包
            //var sinaSession = new SinaResourceSession(new HttpSuppplier(), new AccessToken("2.00YnCkXDrMOAED8c572cd15bunbBRC")) { UID = "1404376560" };
            //sinaSession.Request<SinaUserInfoResult>(new Uri(sinaSession.RequestUserInfoPtl()));
            #endregion

            #region 触发Qzone错误包

            var qzoneSession = new QzoneResourceSession(new HttpSuppplier(), new AccessToken("12345")){AppId = "12345",OpenId = "12345"};
            var userInfo = qzoneSession.Request<QzoneUserInfoResult>(new Uri(qzoneSession.RequestUserInfoPtl()));
            #endregion
        }
Esempio n. 4
0
        public void HandleError()
        {
            #region 触发WeiXin错误包
            //WxResourceSession   wxSession = new WxResourceSession(new HttpSuppplier(),new AccessToken("test")){OpenId = "test"};
            //wxSession.Request<WxUserInfoResult>(new Uri(wxSession.RequestUserInfoPtl()));
            #endregion

            #region 触发WeiBo错误包
            //var sinaSession = new SinaResourceSession(new HttpSuppplier(), new AccessToken("2.00YnCkXDrMOAED8c572cd15bunbBRC")) { UID = "1404376560" };
            //sinaSession.Request<SinaUserInfoResult>(new Uri(sinaSession.RequestUserInfoPtl()));
            #endregion

            #region 触发Qzone错误包

            var qzoneSession = new QzoneResourceSession(new HttpSuppplier(), new AccessToken("12345"))
            {
                AppId = "12345", OpenId = "12345"
            };
            var userInfo = qzoneSession.Request <QzoneUserInfoResult>(new Uri(qzoneSession.RequestUserInfoPtl()));
            #endregion
        }