예제 #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            InitAppCurtule.DefaultLanguage();
            bool bCreatedNew;

            GSSUI.SharData.GetUIInfo();

            //System.Globalization.CultureInfo UICulture = new System.Globalization.CultureInfo("zh-CHT");
            //Thread.CurrentThread.CurrentUICulture = UICulture;

            Mutex m             = new Mutex(false, "GSSClient2013", out bCreatedNew);
            bool  canRunManyApp = false;

            ShareData.Log = log4net.LogManager.GetLogger("GSSLog");
            GSSModel.Response.GameConfig fs = ClientCache.GetGameConfigByName("OnlyRunSingleGssClient").FirstOrDefault();//gss客户端只能单实例启动
            if (fs != null && fs.GameValue == "false")
            {
                canRunManyApp = true;
            }
            if (!bCreatedNew && !canRunManyApp)
            {
                MsgBox.Show(LanguageResource.Language.Tip_OnlyRunSignleApp, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                ShareData.Log.Info("启动系统");
                //登录窗口,用户验证
                " will go to login".Logger();
                FormLoginEx form = new FormLoginEx();
                if (form.ShowDialog() == DialogResult.OK)
                {
                    "login success ,will go to run the FormTask".Logger();
                    // form.Close();
                    //记录日志
                    ShareData.Log.Info("通过验证,成功登录系统");
                    "call ShareData.Log.Info".Logger();
                    Application.EnableVisualStyles();
                    "Application.EnableVisualStyle,will call Application.Run".Logger();
                    Application.Run(new FormTask());
                }
            }
        }
 private void btnLanguageSwitch_Click(object sender, EventArgs e)
 {
     //当前进程语言
     InitAppCurtule.SwitchLanguage();
     FormLoginEx_Load(this, null);
 }