Imports System
Imports System.IO
Public Class MainClass
Shared Private WithEvents m_FileSystemWatcher As FileSystemWatcher
Shared Sub Main()
m_FileSystemWatcher = New FileSystemWatcher("C:\")
m_FileSystemWatcher.EnableRaisingEvents = True
End Sub
' Watch for file creations.
Shared Private Sub m_FileSystemWatcher_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles m_FileSystemWatcher.Created
Console.WriteLine(e.FullPath & " created")
End Sub
End Class
|