コード例 #1
0
        static void Main()
        {
            bool flag = false;

            mutex = new System.Threading.Mutex(true, "MyChat", out flag);
            if (!flag)
            {
                MessageBox.Show("当前程序已启动", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            Application.ThreadException += Application_ThreadException;
            System.AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            System.Threading.Tasks.Task.Run(() =>
            {
                Sysconstant.AutoStart(true, Application.ExecutablePath);
            });
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FormMain());
        }
コード例 #2
0
 void FormConfig_Load(object sender, EventArgs e)
 {
     //throw new NotImplementedException();
     this.checkBox1.Checked = Sysconstant.GetAutoStart(Application.ExecutablePath);
 }
コード例 #3
0
 void checkBox1_CheckedChanged(object sender, EventArgs e)
 {
     //throw new NotImplementedException();
     Sysconstant.AutoStart(this.checkBox1.Checked, Application.ExecutablePath, true);
 }