当前位置:学会吧培训频道电脑知识学习网页制作移动WAP开发用C#读取sina天气预报到wap页面» 正文

用C#读取sina天气预报到wap页面

[08-08 00:46:21]   来源:http://www.xuehuiba.com  移动WAP开发   阅读:8806
概要: 页</mobile:Link></FONT></mobile:form> public class weather : System.Web.UI.MobileControls.MobilePage ...{ protected System.Web.UI.MobileControls.Label Label1; protected System.Web.UI.MobileControls.Label Label2; protected System.Web.UI.MobileControls.SelectionList s_weather; protected System.Web.UI.MobileControls.Label l_date; protected System.Web.UI.MobileControls.Labe
用C#读取sina天气预报到wap页面,标签:移动WAP开发教程,wap网站开发,http://www.xuehuiba.com
            页</mobile:Link></FONT></mobile:form>

            public class weather : System.Web.UI.MobileControls.MobilePage
            ...{
            protected System.Web.UI.MobileControls.Label Label1;
            protected System.Web.UI.MobileControls.Label Label2;
            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_w1;
            protected System.Web.UI.MobileControls.Label l_w2;
            protected System.Web.UI.MobileControls.Label l_w3;
            protected System.Web.UI.MobileControls.Link Link1;
            protected System.Web.UI.MobileControls.Command Command1;
            protected System.Web.UI.MobileControls.Label Label3;
            protected System.Web.UI.MobileControls.Form Form1;

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

            start = wea_city.IndexOf("<b>",0,wea_city.Length);
            stop = wea_city.IndexOf("</b>", start);
            weather1 = wea_city.Substring(start, stop-start).Trim() + " ";
            weather1 = weather1.Substring(3,8).Trim();

            start =
            wea_city.IndexOf("<tdstyle="font-size:40px;font-family:TimesNewRoman;font-weight:bold;">",0,wea_city.Length);
            stop = wea_city.IndexOf("℃",start) + 40;
            weather2 = wea_city.Substring(start, stop-start);
            weather2 = weather2.Substring(stop-start-42,40).Trim();
            weather2 = weather2.Replace(" ","");

            start = wea_city.IndexOf("<fontcolor=#183888><b>", 0,
            wea_city.Length);

上一页  [1] [2] [3] [4] [5] [6]  下一页


Tag:移动WAP开发移动WAP开发教程,wap网站开发电脑知识学习 - 网页制作 - 移动WAP开发
《用C#读取sina天气预报到wap页面》相关文章
Copyright 学会吧 All Right Reserved.
在线学习社区!--学会吧
1 2 3 4 5 6 7 7 8 9 10 11 12 13