예제 #1
0
        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());
            }
        }
예제 #2
0
 public void setDatabaseCredential(DatabaseCredential dbcred)
 {
     databaseCredential = dbcred;
     connection         = new MySqlConnection(String.Format(Queries.connection, dbcred.host, dbcred.username, dbcred.password, dbcred.database));
     connection.Open();
 }