コード例 #1
0
ファイル: DBManager.cs プロジェクト: Pete107/mydubedu
 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
ファイル: Select_Server_UI.cs プロジェクト: lvlerlin/All
        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"))
                };
        }