static void Main() { if (Properties.Settings.Default.first_Launch) { if (Properties.Settings.Default.lastWorkDate != DateTime.Today) { DialogResult result; result = MessageBox.Show("Последнее использование программы: " + Properties.Settings.Default.lastWorkDate.ToString("dd MMMM") + "\r\n" + "Текущая дата: " + DateTime.Today.ToString("dd MMMM") + "\r\n" + "Выполнить архивацию?", "Архивация", MessageBoxButtons.YesNoCancel); if (result == DialogResult.Cancel) { return; } if (result == DialogResult.Yes) { CatalogControl.Start(Properties.Settings.Default.lastWorkDate); } Properties.Settings.Default.lastWorkDate = DateTime.Today; Properties.Settings.Default.Save(); } } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
private void btn_Archive_Click(object sender, EventArgs e) { DialogResult result; result = MessageBox.Show("Очистить каталоги и архивировать задним числом?", "Архивация", MessageBoxButtons.YesNo); if (result == DialogResult.No) { return; } if (result == DialogResult.Yes) { CatalogControl.Start(DateTime.Today.AddDays(-1)); } }