使用google plus登录 [英] Login with google plus
问题描述
Heloo,
这里正在开发使用google plus登录的代码。这里的数据是json格式的。
但是我想将json格式转换为普通的字符串格式。请帮帮我。
这是我的网址:
字符串URI =https:// www.googleapis.com/oauth2/v1/userinfo?access_token=+ Request.QueryString [access_token]。ToString();
来自这个网址数据。
WebClient webClient = new WebClient();
Stream stream = webClient.OpenRead(URI);
string b;
这里我想以字符串格式从该网址获取数据。请帮助我。
Heloo,
Here am developing the code for login with google plus. Here the data is coming in json format.
But i want to convert that json format to normal string format. Please help me.
Here this is my url:
String URI = "https://www.googleapis.com/oauth2/v1/userinfo?access_token=" + Request.QueryString["access_token"].ToString();
from this url am getting the data.
WebClient webClient = new WebClient();
Stream stream = webClient.OpenRead(URI);
string b;
Here i want to get the data from that url in string format. Please help me.
推荐答案
可能是最简单的方法,
Might be the easiest way,
using(WebClient client = new WebClient())
{
string s = client.DownloadString(url);
}
-KR
-KR
这篇关于使用google plus登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!