Global 中的Timer

存在问题,请各位指教。定时器不能定时调用这个事件中的GetFenleiydCh(sb, xmlList) 但是同样的写法的获取图片的方法就能获取,定时更新的,很疑惑,请各位指点一二。

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,定时器,global)