Код: Выделить всё
HTTP/1.1 200 OK
Date: Fri, 01 Aug 2014 21:49:48 GMT
Server: Apache
X-Powered-By: PHP/5.3.3
Connection: close
Content-Length: 125478
Access-Control-Allow-Origin: *
Content-Type: application/json
Content-Language: en
{"request":{"command":"project","project_id":"XYZ123"},"project":[{"project_id":"XYZ123","name":"Project Financials","description":"Sales","state":"CA","dept":"Finance","modified":"2014-08-01","data":[["20140801", 112423],["20140731", 689944],["20140730", 9855], ["20140729", 13118], ["20140728", 9448],
... more data ...
["20140318", 1546], ["20140317", 5467], ["20140316", 19578], ["20140315", 90158]]}]}
Код: Выделить всё
public class DailySales
{
public datetime Date { get; set; }
public int UnitsSold { get; set; }
}
Код: Выделить всё
private void GetSales()
{
var webClient = new WebClient();
webClient.OpenReadCompleted += webClient_OpenReadCompleted;
webClient.OpenReadAsync(new Uri("http://3rdPartySite.com"));
}
void webClient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
var json = new DataContractJsonSerializer(typeof(List));
var data = (List)json.ReadObject(e.Result); // returns null
}
Подробнее здесь: https://stackoverflow.com/questions/250 ... -using-net
Мобильная версия