知识大全 用C#读取sina天气预报到wap页面

Posted

篇首语:我不知道离别的滋味是这样凄凉,我不知道说声再见要这么坚强。本文由小常识网(cha138.com)小编为大家整理,主要介绍了知识大全 用C#读取sina天气预报到wap页面相关的知识,希望对你有一定的参考价值。

用C#读取sina天气预报到wap页面  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!

  <%@ Register TagPrefix= mobile             Namespace= System Web UI MobileControls             Assembly= System Web Mobile %><%@ Page language= c#             Codebehind= weather aspx cs Inherits= goodwap life weather             AutoEventWireup= false %><mobile:form id= Form runat= server >            <FONT face= 宋体 >            <mobile:Label id= Label runat= server             Font Bold= True >【生活资讯】</mobile:Label>            <mobile:Label id= Label runat= server             Font Italic= True >==天气预报==</mobile:Label>            <mobile:Label id= l_date runat= server ></mobile:Label>            <mobile:Label id= l_city runat= server ></mobile:Label>            <mobile:Label id= l_wea runat= server ></mobile:Label>            <mobile:Label id= l_sky runat= server ></mobile:Label>            <mobile:Label id= l_w runat= server ></mobile:Label>            <mobile:Label id= l_w runat= server ></mobile:Label>            <mobile:Label id= l_w runat= server ></mobile:Label>            <mobile:Label id= Label runat= server >【请选择城市名】 </mobile:Label>            <mobile:SelectionList id= s_weather runat= server >            <Item Value= 深圳 Text= 深圳 Selected= True ></Item>            <Item Value= 广州 Text= 广州 ></Item>            <Item Value= 上海 Text= 上海 ></Item>            <Item Value= 北京 Text= 北京 ></Item>            <Item Value= 天津 Text= 天津 ></Item>            <Item Value= 武汉 Text= 武汉 ></Item>            <Item Value= 重庆 Text= 重庆 ></Item>            <Item Value= 成都 Text= 成都 ></Item>            <Item Value= 南京 Text= 南京 ></Item>            <Item Value= 香港 Text= 香港 ></Item>            <Item Value= 澳门 Text= 澳门 ></Item>            </mobile:SelectionList>            <mobile:Command id= Command runat= server >查 询</mobile:Command>            <mobile:Link id= Link runat= server             NavigateUrl= /default aspx#Goodview >首             页</mobile:Link></FONT></mobile:form>

  public class weather : System Web UI MobileControls MobilePage                        protected System Web UI MobileControls Label Label ;            protected System Web UI MobileControls Label Label ;            protected System Web UI MobileControls SelectionList s_weather;            protected System Web UI MobileControls Label l_date;            protected System Web UI MobileControls Label l_city;            protected System Web UI MobileControls Label l_wea;            protected System Web UI MobileControls Label l_sky;            protected System Web UI MobileControls Label l_w ;            protected System Web UI MobileControls Label l_w ;            protected System Web UI MobileControls Label l_w ;            protected System Web UI MobileControls Link Link ;            protected System Web UI MobileControls Command Command ;            protected System Web UI MobileControls Label Label ;            protected System Web UI MobileControls Form Form ;

  private void Page_Load(object sender System EventArgs e)                        // 在此处放置用户代码以初始化页面            if (!Page IsPostBack)                        string city = 深圳 ;            int start stop;            string weather weather wea;            string wea_city = weather_city(city);            wea_city = wea_city Replace( );

  start = wea_city IndexOf( <b> wea_city Length);            stop = wea_city IndexOf( </b> start);            weather = wea_city Substring(start stop start) Trim() + ;            weather = weather Substring( ) Trim();

  start =             wea_city IndexOf( <td> wea_city Length);            stop = wea_city IndexOf( ℃ start) + ;            weather = wea_city Substring(start stop start);            weather = weather Substring(stop start ) Trim();            weather = weather Replace( );

  start = wea_city IndexOf( <fontcolor=# ><b>             wea_city Length);            stop = wea_city IndexOf( </b></font> start);            wea = wea_city Substring(start stop start);            wea = wea Substring( wea Length ) + kbrk ;            wea = wea Replace( );            wea = wea Replace( > k );            wea = wea Replace( < k );            wea = wea Replace( kbrk k );            string [] wall = null;            char[] seperator = k ;            wall = wea Split(seperator);

  /**///////////////////////////////////////            l_city Text = [城市] + city;            l_wea Text = [天气] + weather ;            l_sky Text = [温度] + weather ;            /**////////            l_date Text = wall[ ];            l_w Text = wall[ ];            l_w Text = wall[ ];            l_w Text = wall[ ];                       

  Web 窗体设计器生成的代码#region Web 窗体设计器生成的代码            override protected void OnInit(EventArgs e)                        //            // CODEGEN: 该调用是 ASP NET Web 窗体设计器所必需的             //            InitializeComponent();            base OnInit(e);           

  /**//// <summary>            /// 设计器支持所需的方法 不要使用代码编辑器修改            /// 此方法的内容             /// </summary>            private void InitializeComponent()                        this Command Click += new System EventHandler(this Command _Click);            this Load += new System EventHandler(this Page_Load);

              #endregion

  private void Command _Click(object sender System EventArgs e)                        string city = s_weather Selection Value Trim();            int start stop;            string weather weather wea;            string wea_city = weather_city(city);            wea_city = wea_city Replace( );

  start = wea_city IndexOf( <b> wea_city Length);            stop = wea_city IndexOf( </b> start);            weather = wea_city Substring(start stop start) Trim() + ;            weather = weather Substring( ) Trim();

  start =             wea_city IndexOf( <td> wea_city Length);            stop = wea_city IndexOf( ℃ start) + ;            weather = wea_city Substring(start stop start);            weather = weather Substring(stop start ) Trim();            weather = weather Replace( );

  start = wea_city IndexOf( <fontcolor=# ><b>             wea_city Length);            stop = wea_city IndexOf( </b></font> start);            wea = wea_city Substring(start stop start);            wea = wea Substring( wea Length ) + kbrk ;            wea = wea Replace( );            wea = wea Replace( > k );            wea = wea Replace( < k );            wea = wea Replace( kbrk k );            string [] wall = null;            char[] seperator = k ;            wall = wea Split(seperator);

  /**///////////////////////////////////////            l_city Text = [城市] + city;            l_wea Text = [天气] + weather ;            l_sky Text = [温度] + weather ;            /**////////            l_date Text = wall[ ];            l_w Text = wall[ ];            l_w Text = wall[ ];            l_w Text = wall[ ];            

cha138/Article/program/net/201311/11568

相关参考

知识大全 C#用Activex实现Web客户端读取RFID功能

C#用Activex实现Web客户端读取RFID功能  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!

知识大全 使用C#读取dbf行情文件

使用C#读取dbf行情文件  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!  由于历史的原因我国的上

知识大全 c#通过网线读取三菱PLC数据

c#通过网线读取三菱PLC数据  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!  publicsta

知识大全 在C#中如何读取配置文件[1]

在C#中如何读取配置文件[1]  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!  配置文件概述  应

知识大全 在C#中如何读取配置文件[2]

在C#中如何读取配置文件[2]  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!  不同的type不但

知识大全 在C#中如何读取配置文件[3]

在C#中如何读取配置文件[3]  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!通过上面的代码我们可以

知识大全 C#对数据库的读取,写,更新和删除

C#对数据库的读取,写,更新和删除  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!  ●读取数据其中

知识大全 C#来创建和读取XML文档

C#来创建和读取XML文档  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!  扩展标记语言XML(e

知识大全 C#如何读取和创建INI文件

C#如何读取和创建INI文件  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!  在做项目过程中有时需

知识大全 c#文件的创建、读取及写入

  在c#中运用到操作流时首先要加入以下两个命名空间  usingSystemIO;  usingSystemCollections;  我总结了以下几种方式来进行IO操作很简便但却很实用  目录的创