RestSharpから収集したデータを表示しようとしています。たとえば、次のコードがありますが、現在のようにデータを表示する方法がわかりません。
private void readJSON()
{
string url = "http://www.jsonurl.com";
var restClient = new RestClient(url);
var request = new RestRequest(Method.GET);
//82.147.22.3
//What we are requesting:value
request.AddParameter("apikey", "xxxxxtheapikeygoesherexxxxx");
restClient.ExecuteAsync<Entry>(request, response =>
{
//What to do with the JSON?
});
}
ExecuteAsync <>()の間にJSONを配置する必要があることはわかっていますが、データを取得して、たとえばリストボックスに配置できるようにしたいです。以下は、JSONtoSharp.comから返される結果の例です。コード:
public class Change
{
public string direction { get; set; }
public int amount { get; set; }
public int actual { get; set; }
}
public class itementry
{
public int position { get; set; }
public int prePosition { get; set; }
public int Weeks { get; set; }
public string ar { get; set; }
public string ti { get; set; }
public Change ch { get; set; }
}
public class RootObject
{
public int charDate { get; set; }
public int retrieved { get; set; }
public List<Entry> entries { get; set; }
}
答えはガラスのように単純だと確信しています。私はこれで完全に迷子になっているので、助けが必要です。私を助けるための良いドキュメントを見つけることができません!
注:これは、RestSharpとNewtonsoftを使用するWindows Phone 7のC#用です