var jobj = JsonConvert.DeserializeObject<Newtonsoft.Json.Linq.JContainer>(arg);
listBoxEki.Items.AddRange(jobj["response"]["station"].Select(p=>p["name"]).ToArray());
class MyJsonFormat
{
/// <summary>
/// 都道府県情報
/// </summary>
public class PrefectureResponse
{
public class Prefecture
{
public string[] prefecture { get; set; }
public Prefecture()
{
prefecture = new string[] { };
}
}
public Prefecture response { get; set; }
public PrefectureResponse()
{
response = new Prefecture();
}
}
/// <summary>
/// 路線情報
/// </summary>
public class LineResponse
{
public class Line
{
public string[] line { get; set; }
public Line()
{
line = new string[] { };
}
}
public Line response { get; set; }
public LineResponse()
{
response = new Line();
}
}
/// <summary>
/// 駅情報
/// </summary>
public class StationResponse
{
public class Station
{
public double x{get;set;}
public string next{get;set;}
public string prev{get;set;}
public double y { get; set; }
public string line { get; set; }
public string postal { get; set; }
public string name { get; set; }
public string prefecture { get; set; }
public Station()
{
x = y = 0;
next = prev = line = postal = name = prefecture = "";
}
}
public class Stations
{
public Station[] station { get; set; }
public Stations()
{
station = new Station[] { };
}
}
public Stations response { get; set; }
public StationResponse()
{
response = new Stations();
}
}
}