标签:http tput list nbsp encoding obj set put oca
string url ="http://api.map.baidu.com/telematics/v3/weather?location=昌图&output=json&ak=************";
WebClient wc =newWebClient();
wc.Encoding=Encoding.UTF8;
var txt = wc.DownloadString(url);
var xx =JsonConvert.DeserializeObject<BaiduWeather>(txt);
publicclassIndex
{
publicstringTitle{ get;set;}
publicstringZs{ get;set;}
publicstringTipt{ get;set;}
publicstringDes{ get;set;}
}
publicclassWeather_data
{
publicstringDate{ get;set;}
publicstringDayPictureUrl{ get;set;}
publicstringNightPictureUrl{ get;set;}
publicstringWeather{ get;set;}
publicstringWind{ get;set;}
publicstringTemperature{ get;set;}
}
publicclassResults
{
publicstringCurrentCity{ get;set;}
publicstringPm25{ get;set;}
publicList<Index>Index{ get;set;}
publicList<Weather_data>Weather_data{ get;set;}
}
publicclassBaiduWeather
{
publicintError{ get;set;}
publicstringStatus{ get;set;}
publicDateTimeDate{ get;set;}
publicList<Results>Results{ get;set;}
}
标签:http tput list nbsp encoding obj set put oca
原文地址:http://www.cnblogs.com/iaisoft/p/6939659.html