[Solved] how to modify this single thread into multithreading in c# .net [closed]

This appears to already be multi-threaded. Try adding logging code to the start and end of each FileGenerationForXXX method so you can see the four methods starting together and stopping separately. private void FileGenerationForITD() { eventlog1.WriteEntry(“FileGenerationForITD started.”); … eventlog1.WriteEntry(“FileGenerationForITD finished.”); } Additionally, you can knock out all of the if statements. The thread objects are … Read more

[Solved] Port reading application in .Net which is better Windows service or Windows application

Yes, a windows service would be fine. I’d like to use a little library called TopShelve to make a service / console app. Then I’d add NancyFx to expose the service and it’s data (or read it from a shared database). You also asked if there was a ‘better’ way. You might argue that polling … Read more

[Solved] Bad timer in Windows service

You have most likely an error somewhere in your timer making it throw an exception. You will not detect that since System.Timers.Timer silently ignores all unhandled exceptions. You’ll therefore have to wrap all code with a try/catch block: private void getFileList(object sender, EventArgs e) { try { DeleteOldBackupFiles(); } catch (Exception ex) { //log exception … Read more

[Solved] how to use windows service in windows form application [closed]

You can use Timer to periodically update the database Timer timer = new Timer(); timer.Tick += new EventHandler(timer_Tick); // Everytime timer ticks, timer_Tick will be called timer.Interval = (10) * (1); // Timer will tick evert 10 seconds timer.Enabled = true; // Enable the timer timer.Start(); void timer_Tick(object sender, EventArgs e) { //Put your technique … Read more

[Solved] WMI lib to start windows service remotely

There is documentation regarding the library on github: https://github.com/tjguk/wmi/blob/master/docs/cookbook.rst I believe the above code is throwing an error because you are not specifying which service to start. Assuming you don’t know what services are available to you: import wmi c = wmi.WMI() # Pass connection credentials if needed # Below will output all possible service … Read more