Ejemplo n.º 1
0
 private void CbAutostart_CheckedChanged(object sender, EventArgs e)
 {
     if (CbAutostart.Checked)
     {
         CbAutoQuit.Enabled = true;
         try
         {
             CommonFunction.AddStartup("CurseFetcher", Application.ExecutablePath);
         }
         catch
         {
             ShowError("尝试加入自动启动失败!请确保具有足够权限");
         }
     }
     else
     {
         CbAutoQuit.Enabled = false;
         try
         {
             CommonFunction.RemoveStartup("CurseFetcher");
         }
         catch
         {
             ShowError("尝试取消自动启动失败!请确保具有足够权限");
         }
     }
 }