private void Page_Load(object sender, System.EventArgs e)
{
WebRequest wreq=WebRequest.Create("http://weather.yahoo.com/forecast/CHXX0133_c.html");
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;
// string aa="<div class=\"five-day-forecast night\" style=\"border:none;\">";
//string aa="<div class=\"five-day-forecast\" style=\"border:none;\">";
string aa="<table><th>Today</th>";
start = HTML.IndexOf(aa,0,HTML.Length);
stop = HTML.IndexOf("</table>",start)+8;
temp = HTML.Substring(start, stop - start);
this.Weather2.Text=temp;
&nb
| 对此文章发表了评论 |

