private void btnLuu_Click(object sender, EventArgs e) { try { //xác dịnh vị trí của file cấu hình string path = Application.StartupPath + @"\configDB.txt"; string[] lines = { @"Server=" + txtServerName.Text, "Database=" + txtDatabaseName.Text, "User="******"Pass="******"Không thể kết nối cơ sở dữ liệu, kiểm tra lại thông tin kết nối"); } } catch (Exception ex) { MessageBox.Show("Có lỗi khi ghi file cấu hình"); } }