예제 #1
0
 public DBManager()
 {
     IniParser parser = new IniParser("DBConfig.ini");
     uid = parser.GetSetting("DBSettings", "Username");
     password = parser.GetSetting("DBSettings", "Password");
     database = parser.GetSetting("DBSettings", "DBDatabase");
     server = parser.GetSetting("DBSettings", "IP");
     port = parser.GetSetting("DBSettings", "Port");
     string connectionString;
     connectionString = "SERVER=" + server + ";"
         + "PORT=" + port + ";"
         + "DATABASE=" + database + ";"
         + "UID=" + uid + ";"
         + "PASSWORD="******";";
     connection = new MySqlConnection(connectionString);
     logging.Logging("DBManager Started...");
     OpenConnection();
 }
예제 #2
0
        public Select_Server_UI()
        {
            InitializeComponent();
            txtName.SelectedIndex = 0;

            CONFIG_FILE = new IniParser("Config.ini");
            server = new string[]
            {
                CONFIG_FILE.GetSetting("Servers", "Server1"),
                CONFIG_FILE.GetSetting("Servers", "Server2"),
                CONFIG_FILE.GetSetting("Servers", "Server3")
            };

            server_port = new int[]
                {
                    Convert.ToInt32(CONFIG_FILE.GetSetting("Ports", "Port1")),
                    Convert.ToInt32(CONFIG_FILE.GetSetting("Ports", "Port2")),
                    Convert.ToInt32(CONFIG_FILE.GetSetting("Ports", "Port3"))
                };
        }