Example #1
0
        private static void LoadUserSettings()
        {
            if (Settings.Default.FirstRun)
            {
                EmailSettingsForm emailSettings = new EmailSettingsForm();
                if (emailSettings.ShowDialog() == DialogResult.OK)
                {
                    Settings.Default.FirstRun = false;
                    Settings.Default.Save();
                }
            }

            GettingUserSettings();
        }
Example #2
0
        static void Main(string[] args)
        {
            var handle = GetConsoleWindow();

            // Hide the console window
            ShowWindow(handle, SW_HIDE);

            if (args.Length > 0)
            {
                string s = args[0];
                if (s.ToLower().Equals("--c"))
                {
                    EmailSettingsForm emailSettings = new EmailSettingsForm();

                    if (emailSettings.ShowDialog() == DialogResult.OK)
                    {
                        Settings.Default.FirstRun = false;
                        Settings.Default.Save();
                    }
                }
            }

            LoadUserSettings();

            // Check to see if IP Address has changed and save IP Address
            SaveIPAddress();

            timer = new System.Timers.Timer(CHECK_INTERVAL_MINUTES * 60000);
            timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
            timer.Enabled = true;

            Console.CancelKeyPress += new ConsoleCancelEventHandler(Console_CancelKeyPress);
            Console.ReadKey();
        }