Does anyone know how to close a file? I saved an image... then when i try and save the image to the same filename.. or delete the file after i saved it... i get an error which states that the file is being used by another process. Has anyone come across a problem like this and if so how could I get around it?
Barbarrosa 0
Light Poster
Recommended Answers
Jump to Postadd
file.Close();
after
bitonalBitmap.Dispose();
and see if that works.
Jump to Postits the tif that wont open later right?
Jump to PostI dont understand why it wouldnt work. Does anyone else have an idea for this?
Jump to Postanother alternative is to read/write files through filestreams.
Filestreams dont create a file lock so they wont tie up your files, saving you the hastle of manually calling the grabage collector :)
Jump to PostExcuse me? I'm not saying your code doesnt work most of the time. The problem is that it wont work all of the time. There will be rare occasions where your test says the file exists right before it is deleted, or that it is not in use right before …
All 24 Replies
zAndrew 0
Newbie Poster
Barbarrosa 0
Light Poster
david.crawford 0
Newbie Poster
Barbarrosa 0
Light Poster
Barbarrosa 0
Light Poster
david.crawford 0
Newbie Poster
Barbarrosa 0
Light Poster
david.crawford 0
Newbie Poster
Denis St Flour 0
Newbie Poster
hdjim -2
Newbie Poster
svetikshark 0
Newbie Poster
Geekitygeek 480
Nearly a Posting Virtuoso
hdjim -2
Newbie Poster
eskiya1996 0
Newbie Poster
Geekitygeek 480
Nearly a Posting Virtuoso
sknake
commented:
good eye +6
hdjim -2
Newbie Poster
hdjim -2
Newbie Poster
Geekitygeek 480
Nearly a Posting Virtuoso
hdjim -2
Newbie Poster
Nick Evan
commented:
Fail. -2
Geekitygeek 480
Nearly a Posting Virtuoso
MARKAND911 -1
Junior Poster
JoshuaReen 0
Newbie Poster
Cameronsmith63 9
Light Poster
DanOrtega 0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.