Ejemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     Methods.InitDb();
     if (Methods.CheckAutorun())
     {
         checkBox1.CheckState = CheckState.Checked;
     }
     alertWords.Lines = Methods.InitAlertWords();
     alertApps.Lines  = Methods.InitAlertApps();
     WindowState      = FormWindowState.Minimized;
     ShowInTaskbar    = false;
     WordsMonitor.MonitorAsync();
     AppsMonitor.Monitor();
 }
Ejemplo n.º 2
0
        private void SaveAlertApps(object sender, EventArgs e)
        {
            string query = "";

            foreach (string o in alertApps.Lines)
            {
                query += String.Format("INSERT INTO[AlertApps]([AlertApp]) VALUES('{0}'); ", o);
            }
            using (SQLiteConnection Connect = new SQLiteConnection(Settings.Con))
            {
                string        commandText = "DELETE FROM [AlertApps]";
                SQLiteCommand Command     = new SQLiteCommand(commandText, Connect);
                Connect.Open();
                Command.ExecuteNonQuery();
                Command = new SQLiteCommand(query, Connect);
                Command.ExecuteNonQuery();
                Connect.Close();
            }
            alertApps.Lines = Methods.InitAlertApps();
            AppsMonitor.MonitorAsync();
        }