/ OnCustomCommand(): If you need to send a command to your service without the need for Remoting or Sockets, usethis method to do custom methods. MessageBox.Show( " Service is shutdown") / as saving special data before shutdown. / OnShutdown(): Called when the System is shutting down - Put code here when you need special handling of code that deals with a system shutdown, such / OnContinue(): Put your continue code here - Un-pause working threads, etc. / /// protected override void OnStart(string args) / - Start threads, get inital data, etc. protected override void Dispose( bool disposing) If (( > Convert.ToInt32(minuteFloor)) & ( /// Dispose of objects that need it here. MessageBox.Show("Registry values are " + dayOfWeek + " " + hourInArmyTime + " " + minuteFloor + " " + minuteCeiling) string isRunning = " false" String minuteCeiling = emailerKey.GetValue( " minuteCeiling").ToString() String minuteFloor = emailerKey.GetValue( " minuteFloor").ToString() String hourInArmyTime = emailerKey.GetValue( " hourInArmyTime").ToString() String dayOfWeek = emailerKey.GetValue( " dayOfWeek").ToString() RegistryKey emailerKey = scheduleEmailer.OpenSubKey( SOFTWARE\s\ScheduleEmailer") RegistryKey scheduleEmailer = Registry.LocalMachine files\AllinOneService\logs\" + logDate + "_log.txt", "Service Started - test" +, true, true) .CheckForIllegalCrossThreadCalls = false string logDate = ( false, true) Thread workerThread = new Thread( new ThreadStart(workThread)) / /// The Main Thread: This is where your Service is Run. Set to true if you need it, false otherwise. These Flags set whether or not to handle that specific // type of event. / - Put all of your Initialization code here. / /// Public Constructor for WindowsService. Using System.DirectoryServices // go to add reference and select "System.DirectoryServices" under the. Using System.Threading // go to add reference and select "" under the. I've started to love recursion.There are only few things in world that gives to pain and pleasure and one of them is recursion, lol I just made that up.Īnyways, if you could improve my code and I would really appreciate it. It is still less readable because I just used hit trial thing to correct array out of bound exceptions. Return s.charAt(index) + tailIterator.nextPermutation() TailIterator = new PermutationIterator(s.substring( 0, ++index) + Return index != s.length() - 1 || tailIterator.hasMorePermutations() TailIterator = new PermutationIterator(s.substring( 1)) Private PermutationIterator tailIterator = null
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |