Пример #1
0
        public Configuration()
        {
            _helper = new IO();
            #region [Database]
            ServerName = _helper.Read("Database", "ServerName");
            UserName = _helper.Read("Database", "UserName");
            Password = _helper.Read("Database", "Password");
            DatabaseName = _helper.Read("Database", "Database");
            IsEncryptPassword = _helper.Read("Database", "IsEncrypt");
            #endregion

            #region [Extensions]
            LogPath = _helper.Read("Extensions", "LogPath");
            IPWAN = _helper.Read("Extensions", "IPWAN");
            IPLAN = _helper.Read("Extensions", "IPLAN");
            MacAddress = _helper.Read("Extensions", "MacAddress");
            TemplatePath = _helper.Read("Extensions", "TemplatePath");
            #endregion

            #region [Initialize]
            Language = _helper.Read("Initialize", "Language");
            #endregion
        }
Пример #2
0
 private void Initialize()
 {
     string _username = new IO().Read("Initialize", "Username");
     string _password = new IO().Read("Initialize", "Password");
     string _language = new IO().Read("Initialize", "Language");
     icbLanguage.SelectedIndex = (_language.Equals("en-US")) ? 0 : 1;
     if (!string.IsNullOrEmpty(_username) && !string.IsNullOrEmpty(_password))
     {
         txtUsername.Text = Encryption.Decrypt(_username);
         txtPassword.Text = Encryption.Decrypt(_password);
         txtPassword.Focus();
         chkRemember.Checked = true;
     }
     else chkRemember.Checked = false;
 }
Пример #3
0
 private static void CreateLogFile()
 {
     string strFileName = new IO().Read("Extensions", "LogPath") + @"\iPOSLog_" + DateTime.Now.ToString("yyyy_MM_dd") + ".txt";
     Files.CreateDirectory(new Configuration().LogPath);
     Files.CreateFile(strFileName);
 }