openfiledialog control locks folder

G

Guest

Hello all,
I am using an openFileDialog box to select a file (in order to insert it in
a database). When the file is selected i am filling a few textboxes with the
actual path, filename and extension of the file, so i no longer need the
openfiledialog, thus i am using openfiledialog1.reset() method to reset it.
(i have also tried openfiledialog.dispose() with no results)
The problem i am encountering is that the folder in which the selected file
resides is somehow locked by the application and i can not rename/copy/etc if
i do not close the application (or reopen the openFileDialog to select
another folder).
Is there a way to release the lock on the folder without closing the app ?
Thx in advance
theodore
 
C

Cor Ligthert

Theodore,

That is most unlikely what you tell, I never saw this in these dotNet
newsgroups. Are you sure you have all files closed after using?

Cor
 
H

Herfried K. Wagner [MVP]

juststarter said:
I am using an openFileDialog box to select a file (in order to insert it
in
a database). When the file is selected i am filling a few textboxes with
the
actual path, filename and extension of the file, so i no longer need the
openfiledialog, thus i am using openfiledialog1.reset() method to reset
it.
(i have also tried openfiledialog.dispose() with no results)
The problem i am encountering is that the folder in which the selected
file
resides is somehow locked by the application and i can not rename/copy/etc
if
i do not close the application (or reopen the openFileDialog to select
another folder).

I am able to reproduce this behavior using .NET 1.1 SP1, Windows XP
Professional SP2. Setting the file dialog's 'RestoreDirectory' property to
'True' seems to fix the problem.
 
C

Cor Ligthert

Herfried,

Than I saw it now for the first time.
(And remember that of course)


:)

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top