J
John Dann
I have a remote network application that is placing a frequently
updated copy of an image file on to a network drive every few seconds
and I'm trying to write a little utility to view and automatically
refresh the image on a local PC. The refresh is meant to happen in 2
stages - a file copy and an image refresh - which are both running in
a timer loop:
Timer1_Tick(etc...)
File.Copy(RemoteImageFile, LocalImageFile, True))
Picturebox1.Image = Image.FromFile(LocalImageFile)
Picturebox1.Refresh
End Sub
This runs OK for the first timer event but at the second tick then
there's an IOException at the File.Copy line, apparently because the
file copy cannot complete and then presumably because the picturebox
still has the image file open.
Is there some way of closing the picturebox's access to the file (if
indeed that's what's causing the problem)?
updated copy of an image file on to a network drive every few seconds
and I'm trying to write a little utility to view and automatically
refresh the image on a local PC. The refresh is meant to happen in 2
stages - a file copy and an image refresh - which are both running in
a timer loop:
Timer1_Tick(etc...)
File.Copy(RemoteImageFile, LocalImageFile, True))
Picturebox1.Image = Image.FromFile(LocalImageFile)
Picturebox1.Refresh
End Sub
This runs OK for the first timer event but at the second tick then
there's an IOException at the File.Copy line, apparently because the
file copy cannot complete and then presumably because the picturebox
still has the image file open.
Is there some way of closing the picturebox's access to the file (if
indeed that's what's causing the problem)?