Beispiel #1
0
        //Generate report based on config data from app.config file
        private void GenerateReport()
        {
            var reporter = new clsReporter();

            reporter.AllServers    = ConfigHelp.getAllConnections();
            reporter.StartDate     = ConfigHelp.getStartDate();
            reporter.StopDate      = ConfigHelp.getStopDate();
            reporter.ExcludedGroup = ConfigHelp.getExcludedGroup();
            reporter.ExcludedUser  = ConfigHelp.getExcludedUser();

            reporter.CreateReport();
            MessageBox.Show("Done");
        }
Beispiel #2
0
        //start main process for Watchdog
        public void Start()
        {
            common.StartLogging();
            common.DisplayAndLog("Start Main Program");


            var mainT    = new clsMainServerThread();
            var AllConns = ConfigHelp.getAllConnections();

            foreach (var actCon in AllConns)
            {
                var SrvMainThread = new clsMainServerThread();
                SrvMainThread.Connection = actCon;

                StopFunction StopThisWatcher;
                StopThisWatcher = new StopFunction(SrvMainThread.Stop);
                this.AllStopFunction.Add(StopThisWatcher);

                SrvMainThread.set_fullDealcallback_function(NewFullDealReceive);

                var bwthread = new Thread(SrvMainThread.StartWatch);
                bwthread.Start();
            }

            string KeybordCode = "";

            while (KeybordCode == "")
            {
                Thread.Sleep(10000);
                Console.WriteLine("Press andy key to quit");
                KeybordCode = Console.ReadKey().ToString();
            }

            // stop all threads
            foreach (var stopFunction in this.AllStopFunction)
            {
                stopFunction();
            }
            Thread.Sleep(2000);


            common.DisplayAndLog("Program end");
        }