static void Main() { if (tryconfigure()) { string dbcredstr = File.ReadAllText(Queries.database_conf_file); DatabaseCredential dbcredobj = JsonConvert.DeserializeObject <DatabaseCredential>(dbcredstr); ServerConnector.getInstance().setDatabaseCredential(JsonConvert.DeserializeObject <DatabaseCredential>(dbcredstr)); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new login()); } }
public void setDatabaseCredential(DatabaseCredential dbcred) { databaseCredential = dbcred; connection = new MySqlConnection(String.Format(Queries.connection, dbcred.host, dbcred.username, dbcred.password, dbcred.database)); connection.Open(); }