/// 得到天气数据
///
///
public static string[] GetWeather()
{
Regex regex;
string[] weather = new string[5];
string content = "";
Match mcTmp;
Match mcCity;
int k = 1;
WebRequest theRequest;
theRequest = WebRequest.Create("http://weather.news.qq.com/inc/ss82.htm");
try
{
theResponse = (HttpWebResponse)theRequest.GetResponse();
/// 得到天气数据
///
///
public static string[] GetWeather()
{
Regex regex;
string[] weather = new string[5];
string content = "";
Match mcTmp;
Match mcCity;
int k = 1;
WebRequest theRequest;
theRequest = WebRequest.Create("http://weather.news.qq.com/inc/ss82.htm");
try
{
theResponse = (HttpWebResponse)theRequest.GetResponse();
using (System.IO.Stream sm = theResponse.GetResponseStream())
{
System.IO.StreamReader read = new System.IO.StreamReader(sm, Encoding.Default);
content = read.ReadToEnd();
}
}
catch (Exception)
{
content = "";
}

k = 1;
regex = new Regex(parttenTmp, RegexOptions.Compiled | RegexOptions.IgnoreCase);
for (mcTmp = regex.Match(content), k = 1; mcTmp.Success; mcTmp = mcTmp.NextMatch(), k++)
{
}
parttenTmp = "height=\"23\" align=\"center\">(?[^/]+)";
k = 1;
regex = new Regex(parttenTmp, RegexOptions.Compiled | RegexOptions.IgnoreCase);
for (mcTmp = regex.Match(content), k = 1; mcTmp.Success; mcTmp = mcTmp.NextMatch(), k++)
{
weather[k] = mcTmp.Groups["item1"].Value;
}
return weather;
}