zoukankan      html  css  js  c++  java
  • Global.asax定时器

    void Application_Start(object sender, EventArgs e) 
    {
        //启动定时器
        System.Timers.Timer objTimer3 = new System.Timers.Timer();
        //objTimer3.Interval = 1000 * 60 * 60 * 48;//定时器 2天执行一次(两天48小时) 
        objTimer3.Interval = 1000;//定时器 1秒执行一次 
        objTimer3.Enabled = true;
        objTimer3.Elapsed += new System.Timers.ElapsedEventHandler(insertlvsjcoinnums); 
    }
    //跳转链接
    public void requetappXml(string url)
    {
        System.Net.HttpWebRequest webre = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
        webre.Method = "GET";
        webre.UserAgent = "MSIE6.0";
        System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)webre.GetResponse();
        System.IO.Stream responseStream = response.GetResponseStream();
    }
    public void insertlvsjcoinnums(object sender, System.Timers.ElapsedEventArgs e)
    {
        //跳转需要执行方法的页面
        requetappXml("http://xx.xx.cn/name/default.ashx?xmls=pc/xmls/Global.xmls");
    }
  • 相关阅读:
    1104
    HDU 1575
    hdu 1142(DFS+dijkstra)
    hdu 1015(DFS)
    hdu 1342(DFS)
    hdu 1181(DFS)变 形 课
    hdu 1312(DFS)
    hdu 5976 Detachment
    hdu 5795
    UVa 11729
  • 原文地址:https://www.cnblogs.com/zpblogs/p/11911414.html
Copyright © 2011-2022 走看看