Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

OpenFileDialog creates handle to a folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hayato Iriumi - 27 Jun 2007 20:09 GMT
Hello, folks.
I have an issue with OpenFileDialog. Let's say I chose a file at C:
\TestFolder\TestFile.txt using OpenFileDialog. After I choose the
file, I tried to delete the folder from Windows Explorer, but it says
that another process is being used by another person or program.

So I opened up Process Explorer and checked my Windows application. I
found out that it was holding a handle to the folder that contains the
file I just chose. Whenever I use OpenFileDialog to choose a file, it
seems to create a handle to the folder. I can delete the folder when I
close the application or just close the handle from Process Explorer,
but I need to get around this issue programmatically.

So my question is how do I avoid creating a handle to the folder that
contains the file I chose from OpenFileDialog?
Hayato Iriumi - 27 Jun 2007 20:56 GMT
After a few hours of poking around, found that RestoreDirectory should
be set to True.
I hope this helps people who are having the same issue.

> Hello, folks.
> I have an issue with OpenFileDialog. Let's say I chose a file at C:
[quoted text clipped - 11 lines]
> So my question is how do I avoid creating a handle to the folder that
> contains the file I chose from OpenFileDialog?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.