private void Page_Load(pengirim objek, System.EventArgs e)
{
WebRequest wreq=WebRequest.Create(" http://weather.yahoo.com/forecast/CHXX0133_c.html ");
HttpWebResponse wresp=(HttpWebResponse)wreq.GetResponse();
string HTML ="";
Aliran s=wresp.GetResponseStream();
StreamReader objReader = StreamReader baru(s,System.Text.Encoding.GetEncoding("GB2312"));
string sGaris = "";
ke dalam saya = 0;
sementara (sLine!=null)
{
saya++;
sLine = objReader.ReadLine();
jika (sGaris!=null)
HTML += sGaris;
}
Suhu string= "";
int mulai,berhenti;
// string aa="
string aa="Hari ini ";
mulai = HTML.IndexOf(aa,0,HTML.Panjang);
stop = HTML.IndexOf("",mulai)+8;
temp = HTML.Substring(mulai, berhenti - mulai);
this.Weather2.Text=temp;
string cc="
int bb=temp.IndexOf("
this.Weather2.Text=temp.Substring(aa1, bb - aa1).ToString();
string ee="
int aa2 =temp.IndexOf(ee,0,temp.Length);
int bb1=temp.IndexOf("",aa2);
this.Label1.Text=temp.Substring(aa2, bb1 - aa2).ToString();
// 在此处放置用户代码以初始化页面
}