本文整理汇总了C#中HttpClient.do_get方法的典型用法代码示例。如果您正苦于以下问题:C# HttpClient.do_get方法的具体用法?C# HttpClient.do_get怎么用?C# HttpClient.do_get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpClient
的用法示例。
在下文中一共展示了HttpClient.do_get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: qq_callback
private void qq_callback()
{
string callback = conf.getVal("webhost")+"/account/qq_callback.aspx";//Session["callback"].ToString();
string token_url = "https://graph.qq.com/oauth2.0/token?grant_type=authorization_code&"
+ "client_id=" + Session["appid"] + "&redirect_uri=" + Server.UrlEncode(callback)
+ "&client_secret=" + Session["appkey"] + "&code=" + Request.QueryString["code"];
HttpClient http = new HttpClient();
http.do_get(token_url);
StringUrl url = new StringUrl(http.value);
if (url.get("access_token") != "")
{
Session["access_token"] = url.get("access_token");
Session["expires_in"] = url.get("expires_in");
}
}
示例2: do_reg
protected void do_reg()
{
string getuser_url = "https://graph.qq.com/user/get_user_info?"
+ "access_token=" + Session["access_token"]
+ "&oauth_consumer_key=" + Session["appid"]
+ "&openid=" + Session["openid"]
+ "&format=json";
HttpClient http = new HttpClient();
http.do_get(getuser_url, CHARSET);
StringUrl url = new StringUrl(http.value);
//注册临时账号
PassportBll bll = new PassportBll();
MemberInfo info = new MemberInfo();
info.username = Session["access_token"].ToString();
info.nickname = url.jget("nickname");
info.password = Session["access_token"].ToString();
bll.register(info.username,info.nickname,info.password);
}