private void button2_Click(object sender, EventArgs e) { using (var selectFileDialog = new OpenFileDialog()) { if (selectFileDialog.ShowDialog() == DialogResult.OK) { _variableService.Import(comboBox1.Text, selectFileDialog.FileName); } } }