Asp.net| Program | backstage | skill | Thief Program
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;
String cc= "<tr class=\" titles\ "><td>";
//
int Aa1 =temp. IndexOf (cc,0,temp. Length);
int bb=temp. IndexOf ("</td>", AA1);
This. Weather2.text=temp. Substring (Aa1, BB-AA1). ToString ();
String ee= "<tr class=\" temps\ ">";
int Aa2 =temp. IndexOf (ee,0,temp. Length);
int bb1=temp. IndexOf ("</td>", AA2);
This. Label1.text=temp. Substring (Aa2, BB1-AA2). ToString ();
Place user code here to initialize page
}