1.使用WebClient类获取:
1: WebClient wc1 = new WebClient();
2: wc1.Encoding = Encoding.UTF8;
3: string weatherData1 = wc2.DownloadString(http://www.weather.com.cn/data/sk/101280601.html);
2.使用网页流:
1: HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://www.weather.com.cn/data/sk/101280601.html");
2: request.Timeout = 5000;
3: request.Method = "GET";
4: HttpWebResponse response = (HttpWebResponse)request.GetResponse();
5: StreamReader sr = new StreamReader(response.GetResponseStream());
6: string jsonstr = sr.ReadLine();