您的位置:首页 > 其它

timer 定时器疑惑未解

2013-02-19 15:09 225 查看
存在问题,请各位指教。

1.这个是global.asax.cs中的

     protected void Application_Start(Object sender, EventArgs e)

        {        

          MakeIndexHtml s = new MakeIndexHtml();

            Timer aTimer = new Timer(1000*60*5);

            aTimer.Elapsed += new ElapsedEventHandler(s.btn_CeShiIndex_Click);

            aTimer.Interval = 1000 * 60 *5;

            aTimer.Enabled = true;

            aTimer.AutoReset = true;

            aTimer.Start();

        }

2.同一命名空间下的

 public void btn_CeShiIndex_Click(object sender, EventArgs e)

        {

            string templete_Index_Path = HttpRuntime.AppDomainAppPath + "Templates/Neo/C_index.html";

...

 string Index_Path = System.Configuration.ConfigurationManager.AppSettings["MakeHtmlUrl"].ToString() + "/C_index.html";

 XmlDocument xd = new XmlDocument();

            xd.Load("http://news.youdao.com/top?ct=all&doctype=rss");

            XmlNodeList xmlList = xd.SelectNodes("rss/channel/item/description");

            yd++;

            if (xmlList != null)

            {

                if (((IList)M3).Contains(model.TypeID))

                {

                    if (model.TypeID == 10040103 && yd == 26)

                    {

                        xd.Load("http://news.youdao.com/top?ct=all&doctype=rss");

                        GetFenleiydCh(sb, xmlList);//这个是调用的方法

                  }}}}

  3.读取xml的方法

  protected void GetFenleiYD(StringBuilder sb, XmlNodeList xmlList)

        {

        ...

GetYDFirstTitlefirst(sb, out a, xmlList, i);...}

同样的方法,获取图片timer就可以定时更新,但是这个就不能得到而且为空?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  timer 定时器 global