Example #1
0
        public static void SaveConfig(string fileName)
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(fileName);
            SetValue(xmlDocument, "CurrentUserName", SystemInfo.CurrentUserName);
            SetValue(xmlDocument, "CurrentPassword", SystemInfo.CurrentPassword);
            SetValue(xmlDocument, "MultiLanguage", SystemInfo.MultiLanguage.ToString());
            SetValue(xmlDocument, "CurrentLanguage", SystemInfo.CurrentLanguage);
            SetValue(xmlDocument, "RememberPassword", SystemInfo.RememberPassword.ToString());
            SetValue(xmlDocument, "EncryptClientPassword", SystemInfo.EncryptClientPassword.ToString());
            SetValue(xmlDocument, "EnableCheckIPAddress", SystemInfo.EnableCheckIPAddress.ToString());
            SetValue(xmlDocument, "CurrentStyle", SystemInfo.CurrentStyle.ToString());
            SetValue(xmlDocument, "CurrentThemeColor", SystemInfo.CurrentThemeColor.ToString());
            SetValue(xmlDocument, "EnableCheckPasswordStrength", SystemInfo.EnableCheckPasswordStrength.ToString());
            SetValue(xmlDocument, "EnableEncryptServerPassword", SystemInfo.EnableEncryptServerPassword.ToString());
            SetValue(xmlDocument, "PasswordMiniLength", SystemInfo.PasswordMiniLength.ToString());
            SetValue(xmlDocument, "NumericCharacters", SystemInfo.NumericCharacters.ToString());
            SetValue(xmlDocument, "PasswordChangeCycle", SystemInfo.PasswordChangeCycle.ToString());
            SetValue(xmlDocument, "CheckOnLine", SystemInfo.CheckOnLine.ToString());
            SetValue(xmlDocument, "OnLineTime0ut", SystemInfo.OnLineTime0ut.ToString());
            SetValue(xmlDocument, "AccountMinimumLength", SystemInfo.AccountMinimumLength.ToString());
            SetValue(xmlDocument, "PasswordErrowLockLimit", SystemInfo.PasswordErrowLockLimit.ToString());
            SetValue(xmlDocument, "PasswordErrowLockCycle", SystemInfo.PasswordErrowLockCycle.ToString());
            SetValue(xmlDocument, "DefaultPassword", SecretHelper.smethod_0(SystemInfo.DefaultPassword.ToString()));
            SetValue(xmlDocument, "UseMessage", SystemInfo.UseMessage.ToString());
            SetValue(xmlDocument, "AutoLogOn", SystemInfo.AutoLogOn.ToString());
            SetValue(xmlDocument, "AllowUserToRegister", SystemInfo.AllowUserToRegister.ToString());
            SetValue(xmlDocument, "EnableRecordLog", SystemInfo.EnableRecordLog.ToString());
            SetValue(xmlDocument, "CustomerCompanyName", SystemInfo.CustomerCompanyName);
            SetValue(xmlDocument, "ConfigurationFrom", SystemInfo.ConfigurationFrom.ToString());
            SetValue(xmlDocument, "SoftName", SystemInfo.SoftName);
            SetValue(xmlDocument, "SoftFullName", SystemInfo.SoftFullName);
            SetValue(xmlDocument, "RootMenuCode", SystemInfo.RootMenuCode);
            SetValue(xmlDocument, "Version", SystemInfo.Version);
            SetValue(xmlDocument, "EnableUserAuthorization", SystemInfo.EnableUserAuthorization.ToString());
            SetValue(xmlDocument, "EnableModulePermission", SystemInfo.EnableModulePermission.ToString());
            SetValue(xmlDocument, "EnableTableFieldPermission", SystemInfo.EnableTableFieldPermission.ToString());
            SetValue(xmlDocument, "EnableTableConstraintPermission", SystemInfo.EnableTableConstraintPermission.ToString());
            SetValue(xmlDocument, "LoadAllUser", SystemInfo.LoadAllUser.ToString());
            SetValue(xmlDocument, "Service", SystemInfo.Service);
            SetValue(xmlDocument, "ServiceUserName", SystemInfo.ServiceUserName);
            SetValue(xmlDocument, "ServicePassword", SecretHelper.smethod_0(SystemInfo.ServicePassword));
            SetValue(xmlDocument, "LogOnAssembly", SystemInfo.LogOnAssembly);
            SetValue(xmlDocument, "LogOnForm", SystemInfo.LogOnForm);
            SetValue(xmlDocument, "MainForm", SystemInfo.MainForm);
            SetValue(xmlDocument, "OnLineLimit", SystemInfo.OnLineLimit.ToString());
            SetValue(xmlDocument, "DbType", SystemInfo.BusinessDbType.ToString());
            SetValue(xmlDocument, "BusinessDbType", SystemInfo.BusinessDbType.ToString());
            SetValue(xmlDocument, "RDIFrameworkDbType", SystemInfo.RDIFrameworkDbType.ToString());
            SetValue(xmlDocument, "WorkFlowDbType", SystemInfo.WorkFlowDbType.ToString());
            SetValue(xmlDocument, "EncryptDbConnection", SystemInfo.EncryptDbConnection.ToString());
            SetValue(xmlDocument, "BusinessDbConnection", SystemInfo.BusinessDbConnectionString);
            SetValue(xmlDocument, "RDIFrameworkDbConection", SystemInfo.RDIFrameworkDbConectionString);
            if (SystemInfo.EncryptDbConnection)
            {
                SetValue(xmlDocument, "RDIFrameworkDbConection", SecretHelper.smethod_0(SystemInfo.RDIFrameworkDbConectionString));
            }
            SetValue(xmlDocument, "WorkFlowDbConnection", SystemInfo.WorkFlowDbConnectionString);
            SetValue(xmlDocument, "RegisterKey", SystemInfo.RegisterKey);
            SetValue(xmlDocument, "ErrorReportFrom", SystemInfo.ErrorReportFrom);
            SetValue(xmlDocument, "ErrorReportMailServer", SystemInfo.ErrorReportMailServer);
            SetValue(xmlDocument, "ErrorReportMailUserName", SystemInfo.ErrorReportMailUserName);
            SetValue(xmlDocument, "ErrorReportMailPassword", SecretHelper.smethod_0(SystemInfo.ErrorReportMailPassword));
            SetValue(xmlDocument, "RDIFrameworkBlog", SystemInfo.RDIFrameworkBlog);
            SetValue(xmlDocument, "RDIFrameworkWeibo", SystemInfo.RDIFrameworkWeibo);
            xmlDocument.Save(fileName);
        }