http://m.weather.com.cn/atad/101020100.html
//当前上海天气预报URL
string urlValue= "http://m.weather.com.cn/atad/101020100.html";
//返回Json格式数据
public TResult InvokeMethod<TResult>(string url)
{
using (WebClientChannel scope = new WebClientChannel(url))
{
return scope.Get<TResult>();
}
}
//URL返回值
{"weatherinfo":{"city":"上海","city_en":"shanghai","date_y":"2014年7月6日","date":"六月初十","week":"星期日","fchh":"11","cityid":"101020100","temp1":"29℃~23℃","temp2":"30℃~24℃","temp3":"30℃~24℃","temp4":"32℃~25℃","temp5":"33℃~25℃","temp6":"32℃~26℃","tempF1":"84.2℉~73.4℉","tempF2":"86℉~75.2℉","tempF3":"86℉~75.2℉","tempF4":"89.6℉~77℉","tempF5":"91.4℉~77℉","tempF6":"89.6℉~78.8℉","weather1":"阴","weather2":"小雨转多云","weather3":"多云","weather4":"多云","weather5":"多云","weather6":"多云转小雨","img1":"2","img2":"99","img3":"7","img4":"1","img5":"1","img6":"99","img7":"1","img8":"99","img9":"1","img10":"99","img11":"1","img12":"7","img_single":"2","img_title1":"阴","img_title2":"阴","img_title3":"小雨","img_title4":"多云","img_title5":"多云","img_title6":"多云","img_title7":"多云","img_title8":"多云","img_title9":"多云","img_title10":"多云","img_title11":"多云","img_title12":"小雨","img_title_single":"阴","wind1":"西北风3-4级","wind2":"东北风3-4级","wind3":"东北风3-4级","wind4":"西北风4-5级","wind5":"东风3-4级","wind6":"东南风3-4级","fx1":"西北风","fx2":"西北风","fl1":"3-4级","fl2":"3-4级","fl3":"3-4级","fl4":"4-5级","fl5":"3-4级","fl6":"3-4级","index":"热","index_d":"天气热,建议着短裙、短裤、短薄外套、T恤等夏季服装。","index48":"","index48_d":"","index_uv":"弱","index48_uv":"","index_xc":"不宜","index_tr":"适宜","index_co":"较舒适","st1":"29","st2":"20","st3":"27","st4":"22","st5":"29","st6":"22","index_cl":"较适宜","index_ls":"不太适宜","index_ag":"极不易发"}}