Home All Groups Group Topic Archive Search About

Does File.Exist lock jpg files?

Author
8 May 2006 9:04 PM
tino
I use File.Exist to check whether a certain image exists. Upon successfull
check I want to use the file further but I always get a "The process cannot
access the file because it is being used by another application".
If I do the same exercise with another type (.MID) it works just fine.
Anyone ever come across this?
Grateful for all the help.

Author
9 May 2006 1:25 AM
aaron.kempf@gmail.com
i'd definitely be interested in this answer

i sure hope it doesn't

are these jpgs in a web server??

-Aaron
Author
9 May 2006 5:19 AM
gene kelley
On Mon, 8 May 2006 14:04:01 -0700, tino
<t***@discussions.microsoft.com> wrote:

>I use File.Exist to check whether a certain image exists. Upon successfull
>check I want to use the file further but I always get a "The process cannot
>access the file because it is being used by another application".
>If I do the same exercise with another type (.MID) it works just fine.
>Anyone ever come across this?
>Grateful for all the help.

If you mean something like this:

        If File.Exists("c:\test.jpg") Then
            PictureBox1.Image = Image.FromFile("c:\test.jpg")
        Else
            MessageBox.Show("File not found")
        End If

Above works as expected, here.

Gene