RE: File.Delete problem solved
From: N Thorell (NThorell_at_discussions.microsoft.com)
Date: 10/22/04
- Next message: Peter Foot [MVP]: "Re: Exposing .NET Compact Framework Components to COM"
- Previous message: N Thorell: "Re: File.Delete problem"
- In reply to: N Thorell: "File.Delete problem"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 22 Oct 2004 06:41:08 -0700
I think Bob Powell (MVP) has addressed the problem on his 'faq' site.
The trick seems to be to make a copy of the image immediately, and release
the original ImageFromFile object. (On the other hand I actually used the
method new Bitmap(filename).)
http://www.bobpowell.net/faqfeed.xml
"N Thorell" wrote:
> I get 'file in use' exception when I call File.Delete("myFile.jpg").
> But I can't see any reason for that. The file is open by any application.
> I have loaded the file into an PictureBox.Image earlier, but after that I
> have made
> Image.Dispose() and Image = null and GC.Collect().
> So the question is: Why is the .JPG file still 'in use' ???
- Next message: Peter Foot [MVP]: "Re: Exposing .NET Compact Framework Components to COM"
- Previous message: N Thorell: "Re: File.Delete problem"
- In reply to: N Thorell: "File.Delete problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|