Example #1
0
        private static Boolean Configure_Check()
        {
            Configuration conf = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);

            if (null == conf.AppSettings.Settings["client_id"])
            {
                fmConfigure fmConf = new fmConfigure();
                if (fmConf.ShowDialog() == DialogResult.OK)
                {
                    conf.AppSettings.Settings.Add("client_id", fmConf.AppCode);
                    try {
                        conf.Save(ConfigurationSaveMode.Modified);
                        mAppCode = fmConf.AppCode;
                    }
                    catch (Exception e) {
                        MessageBox.Show("保存配置出错");
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                mAppCode = conf.AppSettings.Settings["client_id"].Value;
            }
            if (!File.Exists(ScriptExecuter.default_script_fn))
            {
                wndEnvCfg fmCfg = new wndEnvCfg();
                if (fmCfg.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }
            }
            return(true);;
        }
Example #2
0
        private static Boolean Configure_Check()
        {
            Configuration conf = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);

            if (null == conf.AppSettings.Settings["client_id"])
            {
                fmConfigure fmConf = new fmConfigure();
                if (fmConf.ShowDialog() == DialogResult.OK)
                {
                    conf.AppSettings.Settings.Add("client_id", fmConf.AppCode);
                    try {
                        conf.Save(ConfigurationSaveMode.Modified);
                        mAppCode = fmConf.AppCode;
                    }
                    catch (Exception e) {
                        MessageBox.Show("保存配置出错");
                        return false;
                    }
                }
                else
                {
                    return false;
                }
            }else mAppCode = conf.AppSettings.Settings["client_id"].Value;
            if (!File.Exists(ScriptExecuter.default_script_fn)) {
                wndEnvCfg fmCfg = new wndEnvCfg();
                if (fmCfg.ShowDialog() != DialogResult.OK)
                {
                    return false;
                }
            }
            return true; ;
        }