コード例 #1
0
        public bool SaveSettings()
        {
            var settings = new DBSettings();

            settings.DBServer   = txtDBHost.Text;
            settings.DBUser     = txtDBUser.Text;
            settings.DBPassword = CryptoSystem.Encrypt(txtDBPassword.Text);

            return(XMLConfigHandler.SaveConfig(settings));
        }
コード例 #2
0
ファイル: DBOperations.cs プロジェクト: BECampbellIT/Demo
        public static bool Initialise()
        {
            settings = (DBSettings)XMLConfigHandler.ReadConfig(typeof(DBSettings));
            if (settings == null)
            {
                MessageLogger.Add("Error ready DBSettings.XML", MessageLogger.MsgLevel.error);
                return(false);
            }

            return(true);
        }
コード例 #3
0
        public DBSettingsCntrl()
        {
            InitializeComponent();

            DBSettings s = (DBSettings)XMLConfigHandler.ReadConfig(typeof(DBSettings));

            if (s != null)
            {
                txtDBHost.Text     = s.DBServer;
                txtDBUser.Text     = s.DBUser;
                txtDBPassword.Text = CryptoSystem.Decrypt(s.DBPassword);
            }
        }