Exemple #1
0
        static void Main()
        {
            IntPtr hMutex = CreateMutex(null, false, Process.GetCurrentProcess().ProcessName);

            if (Marshal.GetLastWin32Error() == ERROR_ALREADY_EXISTS)
            {
                MessageBoxEx.ShowWarning("客户端已启动…");
                return;
            }

            //if (Common.IsCurrentProcessExist())
            //{
            //    MessageBoxEx.ShowWarning("对不起,本地已经有系统正在运行!\n");
            //    System.Environment.Exit(0);
            //}
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            //处理UI线程异常
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            //处理非UI线程异常
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            HXCPcClient.LoginForms.FormLogin Login = new HXCPcClient.LoginForms.FormLogin();
            Login.ShowDialog();//显示登陆窗体
            if (Login.DialogResult == DialogResult.OK)
            {
                GlobalStaticObj.AppMainForm = new HXCMainForm();
                Application.Run(GlobalStaticObj.AppMainForm);//判断登陆成功时主进程显示主窗口
            }
        }
Exemple #2
0
        static void Main()
        {
            IntPtr hMutex = CreateMutex(null, false, Process.GetCurrentProcess().ProcessName);
            if (Marshal.GetLastWin32Error() == ERROR_ALREADY_EXISTS)
            {
                MessageBoxEx.ShowWarning("客户端已启动…");
                return;
            }

            #region 信息注册
            HXC.UI.Library.Controls.ExtDatetimePicker.DateTimeConvert = new DateTimeConvert();
            HXC.UI.Library.Content.ContentTypeManager.RegistType("DbDic", typeof (ContentType4Dictionaries));
            #endregion

            //if (Common.IsCurrentProcessExist())
            //{
            //    MessageBoxEx.ShowWarning("对不起,本地已经有系统正在运行!\n");
            //    System.Environment.Exit(0);
            //}
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            //处理UI线程异常   
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            //处理非UI线程异常   
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            HXCPcClient.LoginForms.FormLogin Login = new HXCPcClient.LoginForms.FormLogin();
            Login.ShowDialog();//显示登陆窗体  
            if (Login.DialogResult == DialogResult.OK)
            {
                GlobalStaticObj.AppMainForm = new HXCMainForm();
                Application.Run(GlobalStaticObj.AppMainForm);//判断登陆成功时主进程显示主窗口  
            }
        }
Exemple #3
0
        static void Main()
        {
            if (Common.IsCurrentProcessExist())
            {
                MessageBoxEx.ShowWarning("对不起,本地已经有系统正在运行!\n");
                System.Environment.Exit(0);
            }
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            //处理UI线程异常   
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            //处理非UI线程异常   
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            HXCPcClient.LoginForms.FormLogin Login = new HXCPcClient.LoginForms.FormLogin();
            Login.ShowDialog();//显示登陆窗体  
            if (Login.DialogResult == DialogResult.OK)
            {
                GlobalStaticObj.AppMainForm = new HXCMainForm();
                Application.Run(GlobalStaticObj.AppMainForm);//判断登陆成功时主进程显示主窗口  
            }
        }
Exemple #4
0
        static void Main()
        {
            if (Common.IsCurrentProcessExist())
            {
                MessageBoxEx.ShowWarning("对不起,本地已经有系统正在运行!\n");
                System.Environment.Exit(0);
            }
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            //处理UI线程异常
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            //处理非UI线程异常
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            HXCPcClient.LoginForms.FormLogin Login = new HXCPcClient.LoginForms.FormLogin();
            Login.ShowDialog();//显示登陆窗体
            if (Login.DialogResult == DialogResult.OK)
            {
                GlobalStaticObj.AppMainForm = new HXCMainForm();
                Application.Run(GlobalStaticObj.AppMainForm);//判断登陆成功时主进程显示主窗口
            }
        }