public void SaveIni(string Key, string Val, String Section) { try { string IniPath = Environment.CurrentDirectory + "\\settings.ini"; clsIni ci = new clsIni(IniPath); ci.Write(Key, Val, Section); } catch { } }
public bool UnMaskPassword() { bool result = false; try { string IniPath = Environment.CurrentDirectory + "\\settings.ini"; clsIni ci = new clsIni(IniPath); string Value = ci.Read("UnMaskPassword", "SystemSettings"); result = bool.Parse(Value); } catch { } return(result); }
public string ConnectionString() { string result = string.Empty; try { clsIni ci = new clsIni(Environment.CurrentDirectory + "\\" + "settings.ini"); string ServerName = ci.Read("Servername", "Database"); string DatabaseName = ci.Read("Databasename", "Database"); string UserName = ci.Read("Username", "Database"); string Password = ci.Read("Password", "Database"); result = "Server = " + ServerName + "; Database = " + DatabaseName + "; Uid = " + UserName + "; Pwd = " + Password + ""; } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message.ToString(), "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(result); }
public clsVariableSettings ValidateIni() { clsVariableSettings cvResult = new clsVariableSettings(); try { string IniPath = Environment.CurrentDirectory + "\\settings.ini"; clsIni ci = new clsIni(IniPath); cvResult = new clsVariableSettings(); cvResult.CompanyName = ci.Read("CompanyName", "SystemSettings"); cvResult.LicenseCode = ci.Read("LicenseCode", "Licensing"); cvResult.ActivationCode = ci.Read("ActivationCode", "Licensing"); cvResult.SystemCode = ci.Read("ProgramCode", "Licensing"); cvResult.ServerName = ci.Read("Servername", "Database"); cvResult.DatabaseName = ci.Read("Databasename", "Database"); cvResult.UserName = ci.Read("Username", "Database"); cvResult.Password = ci.Read("Password", "Database"); } catch { } return(cvResult); }