Exemplo n.º 1
0
        /// <summary>
        /// 自动启动
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tspAutoStart_CheckedChanged(object sender, EventArgs e)
        {
            var result = ToolHelper.SetAutoRunWhenStart(Application.StartupPath + @"\STO.Print.exe", tspAutoStart.Checked);

            if (result == "1")
            {
                notifyIcon.ShowBalloonTip(3000, "系统设置", "设置成功,下次开机自动启动" + BaseSystemInfo.SoftFullName, ToolTipIcon.Info);
                BillPrintHelper.SetAutoRunWhenStart(true);
            }
            else if (result == "2")
            {
                notifyIcon.ShowBalloonTip(3000, "系统设置", "取消自启动成功", ToolTipIcon.Info);
                BillPrintHelper.SetAutoRunWhenStart(false);
            }
            else
            {
                notifyIcon.ShowBalloonTip(3000, "系统设置", result, ToolTipIcon.Error);
            }
        }