public void filechk()
{
FileSystemWatcher MyFileWatcher = new FileSystemWatcher();
MyFileWatcher.Path = @"d:\test2\exam2"; //감시할 폴더
MyFileWatcher.Filter = "*.txt"; //필터링
MyFileWatcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName;
MyFileWatcher.Created += new FileSystemEventHandler(OnChanged);
MyFileWatcher.EnableRaisingEvents = true;
}
// Define the event handlers.
public void OnChanged(object source, FileSystemEventArgs e)
{
}