Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Looking for advice

Looking for advice

Scheduled Pinned Locked Moved ASP.NET
tools
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ahmad Adnan
    wrote on last edited by
    #1

    morning guys i have prcedure should be work indefenitly. i dont want to make a windows service. can i put infinit loop in the Application_Start and make the thread sleep for a period while(true) { MyFunction(); System.Thrading.Thread.Sleep(150000); //150000 milisecond = one day } i have alot of utility functions i dont want to copy

    I 1 Reply Last reply
    0
    • A Ahmad Adnan

      morning guys i have prcedure should be work indefenitly. i dont want to make a windows service. can i put infinit loop in the Application_Start and make the thread sleep for a period while(true) { MyFunction(); System.Thrading.Thread.Sleep(150000); //150000 milisecond = one day } i have alot of utility functions i dont want to copy

      I Offline
      I Offline
      il_masacratore
      wrote on last edited by
      #2

      Yes you can do it... But there's a way a little bit elegant. Timer. Create a timer and call "MyFunction" on timer tick. //Sample code using System.Threading; ... //Class level variable private Timer loTimer; //Initialization code (main, constructor...) loTimer = new Timer(new TimerCallback(Timer_Tick), this, 0, 150000); //Timer tick func private void Timer_Tick(object sender) { MyFunction(); }

      Visit my blog at http://dotnetforeveryone.blogspot.com/

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups