korasoglu Posted September 28, 2018 Share Posted September 28, 2018 (edited) System Data Table Arkadaşlar tüm açık uygulamalardan ulaşabileceğim datatable nasıl yapabilirim hiç kullanmadım çözemedim. mantık şu sürekli arka planda timerden zaman kontrol yaptıracağım aynı verileri diğer uygulamadanda ulaşmak istiyorum. Ajanda etkinlik programı birinden işlem yapıcam birinde sürekli kontrol edecek. thereat denedim olmadı şöyle yaptım Thread syncThread = null; System.Timers.Timer timer1; public Service1() { InitializeComponent(); } protected override void OnStart(string[] args) { timer1 = new System.Timers.Timer(); timer1.Interval = 60000; // 1 min timer1.Enabled = true; timer1.Elapsed += new ElapsedEventHandler(timer1_Elapsed); timer1.Start(); } protected override void OnStop() { syncThread.Abort(); timer1.Stop(); } protected void timer1_Elapsed(object sender, ElapsedEventArgs e) { syncThread = new Thread(new ThreadStart(doStuffInMyOwnThread)); syncThread.Start(); } protected void doStuffInMyOwnThread() { // whatever you put here, it will // run for each timer interval that elapses // in a separate thread, and each thread will // end when the processing in this function ends } kullanımını beceremedim. Birde timer ekledim Thread çalışmıyor timer haricinde çalışıyor ama timerden çalışmıyor Edited September 28, 2018 by korasoglu Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted September 28, 2018 Share Posted September 28, 2018 Yukarıdaki kodlar Windows Services kodları konuyla ne ilgisi var anlamadım. Tek söyleceğim şey timer arkaplanda zaten thread sleep kullanıyor. Quote Link to comment Share on other sites More sharing options...
korasoglu Posted September 28, 2018 Author Share Posted September 28, 2018 aynen bende onu kullanmak istiyorum doğru anlamışın. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.