N
Nagachandra Sekhar Grandhi
I am facing a problem with OpenFileDialog. It is as follows.
I opened OpenFileDialog dialog box and selected a folder in it. After
selecting the folder when i tried to delete the same folder in Explorer i am
getting error saying that cannot delete that folder as some process is using
it. After that i selected a file from the same folder in OpenFileDialog.
When i tried to delete the folder after selecting the file also it is giving
the same error.
My code is as follows.
private void diagramButton_Click(object sender, System.EventArgs e)
{
openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "All Files (*.*)|*.*";
openFileDialog.InitialDirectory = "C:\\temp";
openFileDialog.Multiselect = false;
openFileDialog.RestoreDirectory = false;
this.openFileDialog.ShowDialog(this);
if (openFileDialog.FileName.Trim() != string.Empty) {
this.textBox1.Text = openFileDialog.FileName.Trim();
}
openFileDialog.Dispose();
openFileDialog = null;
}
Please tell me the solution for this ASAP.
I opened OpenFileDialog dialog box and selected a folder in it. After
selecting the folder when i tried to delete the same folder in Explorer i am
getting error saying that cannot delete that folder as some process is using
it. After that i selected a file from the same folder in OpenFileDialog.
When i tried to delete the folder after selecting the file also it is giving
the same error.
My code is as follows.
private void diagramButton_Click(object sender, System.EventArgs e)
{
openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "All Files (*.*)|*.*";
openFileDialog.InitialDirectory = "C:\\temp";
openFileDialog.Multiselect = false;
openFileDialog.RestoreDirectory = false;
this.openFileDialog.ShowDialog(this);
if (openFileDialog.FileName.Trim() != string.Empty) {
this.textBox1.Text = openFileDialog.FileName.Trim();
}
openFileDialog.Dispose();
openFileDialog = null;
}
Please tell me the solution for this ASAP.