title: FileSystemWatcher Raising Multiple Events
body: <p>I'm going to start off by apologizing if this is a duplicated question. There were a ton of FileSystemWatcher questions but I didn't see any that addressed my issue.</p>
  
  <p>Ok, so I have a console application in C# that is monitoring a directory, which we will call <code>Root</code>. <code>Root</code> has many subfolders. The purpose of this application is to write to a log file if any .csv files are create, modified, or deleted within <code>Root</code> or any of its subfolders. I currently have this working fine, sort of. The only problem is that when a .csv file is created, modified, or deleted it actually raises the event for all 3. </p>
  
  <p>For example, if I create a file in <code>Root</code> called <code>test.csv</code>, the log file would look like this:</p>
  
  <pre><code> 10/04/2012: File F:/Root/test.csv Created
   10/04/2012: File F:/Root/test.csv Changed
   10/04/2012: File F:/Root/test.csv Created
   10/04/2012: File F:/Root/test.csv Deleted
  </code></pre>
  
  <p>I'm not sure whats going on, so here is the code that sets up the <code>FileSystemWatcher</code></p>
  
  <pre><code> _watchFolder.Path = ConfigurationManager.AppSettings["RootToWatch"];
   _watchFolder.Filter = ConfigurationManager.AppSettings["FileNameToWatch"];
   _watchFolder.NotifyFilter = NotifyFilters.FileName 
                               | NotifyFilters.LastWrite;
   _watchFolder.IncludeSubdirectories = true;
   _watchFolder.Changed += new FileSystemEventHandler(OnChanged);
   _watchFolder.Created += new FileSystemEventHandler(OnChanged);
   _watchFolder.Deleted += new FileSystemEventHandler(OnChanged);
   _watchFolder.Renamed += new RenamedEventHandler(OnRenamed);
  
   try
   {
       _watchFolder.EnableRaisingEvents = true; 
   }
   catch (ArgumentException ex)
   {
       AbortMonitoring(ex.Message);
   }
  </code></pre>
  
  <p>And here is my OnChanged event (Renamed is same but has different argument)</p>
  
  <pre><code>  protected static void OnChanged(object sender, FileSystemEventArgs e)
      {
          //compile message to insert into log file.
          string message = "File: " + e.FullPath + " " + e.ChangeType;
          UpdateLogFile(message);
      }
  </code></pre>