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); }
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); }
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 }
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 }