protected override void OnStart(string[] args) { try { CacheManagement.Start(); } catch (Exception e) { System.IO.File.WriteAllText("c:\\t.txt", e.Message + e.StackTrace); } Stop(); }
static void Main(string[] args) { if (args.Contains("/auto")) { CacheManagement.Start(); } else { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } }
private void Button4_Click(object sender, EventArgs e) { CacheManagement.Start(); string message = "Temporary folder is changed.\n\n" + "But the temporary folder will be deleted when you restart.\n" + "So, we recommend scheduler registration that works automatically at system startup.\n\n" + "Would you like to register?"; if (Scheduler.isRegistered == false) { if (MessageBox.Show(message, "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { Scheduler.Register(); StateUpdate(); } } }