1.页面抓取,获得天气信息
/// <summary>
/// 得到天气数据
/// </summary>
/// <returns>数组(0、天气;1、气温;2、风力;3、紫外线;4、空气)</returns>
public static string[] GetWeather()
{
Regex regex;
string[] weather = new string[5];
string content = "";
Match mcTmp;
Match mcCity;
int k = 1;
HttpWebResponse theResponse;
WebRequest theRequest;
//ss1.htm 注意:ss1-ss303代表了不同的城市,是不连续的
theRequest = WebRequest.Create("http://weather.news.qq.com/inc/ss1.htm");
try
{
theResponse = (HttpWebResponse)theRequest.GetResponse();
using (System.IO.Stream sm = theResponse.GetResponseStream())