I don't know how to integrate the code I wrote on c# with the FileSystemWatcher class
public static void watcherFunc()
{
FileSystemWatcher fileWatcher = new FileSystemWatcher(@"C:\Documents and Settings\Develop\Desktop\test\");
fileWatcher.NotifyFilter = NotifyFilters.LastWrite;
fileWatcher.Changed += new FileSystemEventHandler(OnChanged);
fileWatcher.EnableRaisingEvents = true;
}
// Define the event handlers.
private static void OnChanged(object source, FileSystemEventArgs e)
{
// Specify what is done when a file is changed, created, or deleted.
MessageBox.Show("File: " + e.FullPath + " " + e.ChangeType);
}
I tried to call it in form1 lead event.... I tried to read how to do it and google it with no luck please help...thank you !