private void checkBox_Autostart_CheckedChanged(object sender, EventArgs e) { Autostart start = new Autostart(); if (checkBox_Autostart.Checked) { start.CreateTask(); } else { start.RemoveTask(); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Form form = new mainform(); if (Properties.Settings.Default.FirstRun) { form.Show(); Autostart start = new Autostart(); start.CreateTask(); Properties.Settings.Default.FirstRun = false; Properties.Settings.Default.Save(); } Application.Run(); }