Home All Groups Group Topic Archive Search About

image file locked after use

Author
20 Mar 2006 10:34 PM
thebhone
I am creating a website updater program. Currently working on the image
replacement module here.

For some reason, after an image (say /images/1.jpg) has been
used/opened in the application. I cannot later overwrite it (during the
application), even after i have closed it.

"My.Computer.FileSystem.CopyFile(OpenFileDialog1.FileName,
"\images\posters\" & Me.imagenum & ".jpg", True)"

The process cannot access the file 'C:...\images\posters\1.jpg' because
it is being used by another process.

Is there a way to unload this image so that I can overwrite it? As soon
as my application quits, the lock is removed. I can tell that my
program is locking the file, but the image is not being displayed or
used at that time!!

please help,

Thanks,

Ted

Author
20 Mar 2006 10:36 PM
thebhone
thanks
Author
20 Mar 2006 10:41 PM
thebhone
Form3.PictureBox1.Image = System.Drawing.Bitmap.FromFile(imgpath)

is how it is being loaded.

is there a way to unload that?
Author
20 Mar 2006 11:23 PM
Randy Birch
You should realize that you've asked a VB.net questions in the wrong
newsgroups. The *vb* groups are for VB Classic. All Net-related questions
should be posted to the *dotnet* or *vsnet* newsgroups on
msnew.microsoft.com.

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.




<thebh***@gmail.com> wrote in message
Show quoteHide quote
news:1142894471.466286.304070@g10g2000cwb.googlegroups.com...
: Form3.PictureBox1.Image = System.Drawing.Bitmap.FromFile(imgpath)
:
: is how it is being loaded.
:
: is there a way to unload that?
: