使用http://r.qzone.qq.com/cgi-bin/tfriend/friend_mngfrd_get.cgi?uin=441212678&rd=0.3932640394195914&g_tk=450427580&fupdate=1类似的代码可以返回QQ好友列表的Json数据,一个笨的办法是Ctrl+A全选复制然后粘贴到记事本中再进行进一步处理,我想让HttpWebRequest对象获取返回的数据字符串,比如( {"items":[{"uin":14377775,
"groupid":0,
"name":"陈建刚",
"is_special":"0",
)
代码如下 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream ResStream = response.GetResponseStream();
Encoding encoding = Encoding.GetEncoding("GBK2312");
StreamReader streamReader = new StreamReader(ResStream, encoding);
MessageBox.Show(streamReader.ReadToEnd());
结果却如下很郁闷,请大家帮我看看,我想返回的是Json数组!!是不是要添加缓存信息什么的?求指点! _Callback({
"code":-3000,
"subcode":-4001,
"message":"璇峰厛鐧诲綍銆?,
"notice":0,
"time":1375008469,
"tips":"80CB-1705"
}
);
JSON 缓存 C# 数据格式
|