Home All Groups Group Topic Archive Search About

openfiledialog control locks folder

Author
8 Apr 2005 7:23 AM
juststarter
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

Author
8 Apr 2005 7:31 AM
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
Author
8 Apr 2005 9:03 AM
Herfried K. Wagner [MVP]
Show quote Hide quote
"juststarter" <juststar***@discussions.microsoft.com> schrieb:
> 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.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
8 Apr 2005 9:46 AM
Cor Ligthert
Herfried,

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


:-)

Cor