private void btnSet_Click(object sender, EventArgs e) { //工具参数 tool = getTool(); string loginStr = String.Format("Database={0};Data Source={1};User Id={2};Password={3};pooling=false;CharSet=utf8;port={4}", tool.LoginData, tool.DbHost, tool.DbUser, tool.DbPassword, tool.DbPort); string serverStr = String.Format("Database={0};Data Source={1};User Id={2};Password={3};pooling=false;CharSet=utf8;port={4}", tool.ServerData, tool.DbHost, tool.DbUser, tool.DbPassword, tool.DbPort); mysql_login = new MysqlBase(loginStr); mysql_server = new MysqlBase(serverStr); }
private void Form1_Load(object sender, EventArgs e) { //工具参数 tool = getTool(); string loginStr = String.Format("Database={0};Data Source={1};User Id={2};Password={3};pooling=false;CharSet=utf8;port={4}", tool.LoginData, tool.DbHost, tool.DbUser, tool.DbPassword, tool.DbPort); string serverStr = String.Format("Database={0};Data Source={1};User Id={2};Password={3};pooling=false;CharSet=utf8;port={4}", tool.ServerData, tool.DbHost, tool.DbUser, tool.DbPassword, tool.DbPort); mysql_login = new MysqlBase(loginStr); mysql_server = new MysqlBase(serverStr); //等级下拉框默认选择 this.combVip.SelectedIndex = 0; //读取用户信息 string txtUsername = this.txtUsername.Text.Trim(); if (txtUsername != string.Empty) { getUserInfo(); } }