0

官方数据:实时天气及24小时天气预报

1年前 | 金刚王 | 104次围观

ASP.NET的实时天气及24小时天气预报(C#)

修改其中的url获得其他城市的天气情况

如广州为:

注意仅适用于获得yahoo上的天气预报

.aspx

-----------------------------------

24小时天气

.aspx.cs

---------------------------------------

using ;

using .;

using .;

using .Data;

using .;

using .Web;

using .Web.;

using .Web.UI;

using .Web.UI.;

using .Web.UI.;

using .Net;

using .IO;

test

{

class : .Web.UI.Page

{

.Web.UI..Label ;

.Web.UI..Label ;

.Web.UI.. ;

.Web.UI.. ;

void ( , . e)

{

// Put user code to the page here

}

# Web Form code

void ( e)

{

//

// : This call is by the ASP.NET Web Form .

//

();

base.(e);

}

///

/// for - do not

/// the of this with the code .

///

void ()

{

this..Click += new .(this.);

this..Click += new .(this.);

this.Load += new .(this.);

}

#

void ( , . e)

{

wreq=.("");

wresp=()wreq.();

HTML ="";

s=wresp.();

= new (s);

sLine = "";

int i = 0;

while (sLine!=null)

{

i++;

sLine = .();

if (sLine!=null)

HTML += sLine;

}

temp= "";

int start,stop;

start = HTML.("",0,HTML.);

stop = HTML.("",0,HTML.);

temp = HTML.(start, stop - start);

start = temp.("");

stop = temp.("");

= temp.(start+3,stop - start -3);

start = temp.("stop = temp.("",start);

img = temp.(start实时天气预报24小时,stop - start);

.Text = + "" + img;

}

void ( , . e)

{

wreq=.("");

wresp=()wreq.();

HTML ="";

s=wresp.();

= new (s,.Text..(""));

sLine = "";

int i = 0;

while (sLine!=null)

{

i++;

sLine = .();

if (sLine!=null)

HTML += sLine;

}

temp= "";

int start,stop;

start = HTML.("",0,HTML.);

stop = HTML.(" ",start)+8;

temp = HTML.(start实时天气预报24小时, stop - start);

.Text = temp;

}

}

}

本文发布于http://www.jgmcp.com/ 转载请注明。

标签: tempstart
发表评论