- 打印本文 关闭窗口
- ASP.NET的实时天气及24小时天气预报(C#)
- 作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 14:20:21
- bsp;
HttpWebResponse wresp=(HttpWebResponse)wreq.GetResponse();
string HTML ="";
Stream s=wresp.GetResponseStream();
StreamReader objReader = new StreamReader(s,System.Text.Encoding.GetEncoding("GB2312"));
string sLine = "";
int i = 0;while (sLine!=null)
{
i++;
sLine = objReader.ReadLine();
if (sLine!=null)
HTML += sLine;
}
String temp= "";
int start,stop;
start = HTML.IndexOf("<table border=0 cellpadding=2 cellspacing=1 bgcolor=9999cc width="85%">",0,HTML.Length);stop = HTML.IndexOf("</table>",start)+8;
temp = HTML.Substring(start, stop - start);
Weather2.Text = temp;
}
}
} - 打印本文 关闭窗口