Hi,
VB.NET is saying the file I am creating is in use by another process and
won't complete its task of moving the file to the specified destination
folder.
Here is my code (the main bit anyway)....
Private Sub LogChange(ByVal source As Object, ByVal e As
System.IO.FileS ystemEventArgs)
If e.ChangeType = WatcherChangeTy pes.Created Then
System.IO.File. Move(e.FullPath , textBoxDest.Tex t & "\" & e.Name)
End If
e.FullPath returns the full path and filename of the file created e.g
c:\filename.txt
textboxDest is where the file is to be moved to e.g D:\
e.Name is the filename without the path e.g. filename.txt
This is the error text...
System.IO.IOExc eption: The process cannot access the file
"D:\Unsorted\20 05\New.mp3" because it is being used by another process.
What happens is files get downloaded to the D:\Unsorted\ folder which is
being monitored by the FileSystemWatch er. The app then tries to move the
downloaded/created file to the D:\Unsorted\200 5\ folder then the error
occurs.
Any help much appreciated,
Thanks
Paul
VB.NET is saying the file I am creating is in use by another process and
won't complete its task of moving the file to the specified destination
folder.
Here is my code (the main bit anyway)....
Private Sub LogChange(ByVal source As Object, ByVal e As
System.IO.FileS ystemEventArgs)
If e.ChangeType = WatcherChangeTy pes.Created Then
System.IO.File. Move(e.FullPath , textBoxDest.Tex t & "\" & e.Name)
End If
e.FullPath returns the full path and filename of the file created e.g
c:\filename.txt
textboxDest is where the file is to be moved to e.g D:\
e.Name is the filename without the path e.g. filename.txt
This is the error text...
System.IO.IOExc eption: The process cannot access the file
"D:\Unsorted\20 05\New.mp3" because it is being used by another process.
What happens is files get downloaded to the D:\Unsorted\ folder which is
being monitored by the FileSystemWatch er. The app then tries to move the
downloaded/created file to the D:\Unsorted\200 5\ folder then the error
occurs.
Any help much appreciated,
Thanks
Paul
Comment