-3
我正在捕獲字符串變量中的Http響應。我想將字符串轉換爲json.How如何轉換?如何將字符串轉換爲Json格式?
string responseData;
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
if (response.StatusCode == HttpStatusCode.OK)
{
System.IO.StreamReader responseReader = new System.IO.StreamReader(request.GetResponse().GetResponseStream());
responseData = responseReader.ReadToEnd();
}
你的意思是你想'responseData' JSON格式?它是什麼格式?或者你的意思是'responseData'已經是JSON格式,你想閱讀那個JSON對象? – CodeCaster
顯示您的回覆數據。它是「HTML/JSON/XML」嗎? –