private void btnBrowser_Click(object sender, EventArgs e) { FolderBrowserDialog FolderChooser = new FolderBrowserDialog(); if (FolderChooser.ShowDialog() == DialogResult.OK) { string path = FolderChooser.SelectedPath; if (!string.IsNullOrEmpty(path)) { if (!SystemFolder.isDirEmpty(path)) { txtBrowser.Text = path; SystemFolder.DataDir = txtBrowser.Text; SystemFolder.ClearTestInDir(); SystemFolder.ClearTestOutDir(); SystemFile.GetData(txtBrowser.Text); FolderChooser.Dispose(); } else { MessageBox.Show("the folder is empty ! no data found !"); } } } }