0
安らかなAPIからの応答いくつかのJSONを返す:抽出値
{
"meta": {
"href": "http://localhost:54398/"
},
"busPartner": {
"href": "http://localhost:54398/BusPartner",
"rel": [
"collection"
]
},
"busPartnerType": {
"href": "http://localhost:54398/BusPartnerType",
"rel": [
"collection"
]
},
"busPartnerPossAttrib": {
"href": "http://localhost:54398/BusPartnerPossAttribs",
"rel": [
"collection"
]
}
}
私はJSONからhref
値のリストを抽出しようとしています。私は以下のようにJsonTextReader
を使用して、結果のリストのうち、私は必要な値を取る...
IList<string> tt = new List<string>();
JsonTextReader reader = new JsonTextReader(new StringReader(response));
while (reader.Read())
{
if (reader.Value != null)
{
tt.Add(reader.TokenType + " " + reader.Value);
}
else
{
tt.Add(reader.TokenType.ToString());
}
}
ことができますが...それは不器用と面倒です。より良い方法が必要です。すべての手がかりは?
おかげで、まっすぐなコピーを働きました過去: –