Hello Guys...
I was writing some code to watch all the drives in a system..if any of the file is deleted it pop a message and show deleted file path..
The code compiles just fine.
But there is some problem with the code ..it not giving expected output.
Please somebody help me with editing the code so that it works perfectly...
A little explanation will also be very helpful..
Thanks in Advance.
Code
'class Variables....
Dim usb As String = My.Computer.FileSystem.SpecialDirectories.ToString
Dim Alldrives() As String = IO.Directory.GetLogicalDrives
Private Sub FileSystemWatcher1_Changed(sender As Object, e As FileSystemEventArgs) Handles fsw.Deleted
Dim deletedfile As String
For Each Me.usb In Alldrives
Try
fsw.Path = usb
deletedfile = "File-" & e.FullPath.ToString
MessageBox.Show(deletedfile)
Catch ex As Exception
End Try
NextI was writing some code to watch all the drives in a system..if any of the file is deleted it pop a message and show deleted file path..
The code compiles just fine.
But there is some problem with the code ..it not giving expected output.
Please somebody help me with editing the code so that it works perfectly...
A little explanation will also be very helpful..
Thanks in Advance.
