62,046
社区成员
发帖
与我相关
我的任务
分享
strCode = Request["code"];
Oauth2Base oauthBase = new Oauth2Base();
oauthBase.App_Key = ConfigurationManager.AppSettings["RR_ApiKey"];
oauthBase.App_Secret = ConfigurationManager.AppSettings["RR_SecretKey"];
oauthBase.tokenUrl = ConfigurationManager.AppSettings["RR_ATURL"];
oauthBase.Redirect_Uri = HttpUtility.UrlEncode(ConfigurationManager.AppSettings["RR_CallBack"]);
//获取授权的Access_token值
oauthBase.GetAccessTokenByAuthorizationCode(strCode);
// 获取个人信息
List<APIParameter> paras = new List<APIParameter>();
paras.Add(new APIParameter("v", "1.0"));
paras.Add(new APIParameter("method", "users.getInfo"));
paras.Add(new APIParameter("access_token", oauthBase.Token.access_token));
paras.Add(new APIParameter("format", ConfigurationManager.AppSettings["RR_Format"]));
paras.Add(new APIParameter("call_id", "1232095295656"));//DateTime.Now.Millisecond.ToString()
paras.Add(new APIParameter("fields", "uid,name,sex,tinyurl"));
APIValidation av = new APIValidation();
string strSig = av.CalSig(paras);
paras.Add(new APIParameter("sig", strSig));
string responseData = new SyncHttp().
HttpPost(APIConfig.RenRenAPIURL, HttpUtil.GetQueryFromParas(paras));
List<UserInfo> list = new JavaScriptSerializer().Deserialize<List<UserInfo>>(responseData);
不知道缺少点什么东西?