title: Registry Watcher C#
body: <p>I'm a newbie to WMI and I need to implement <a href="http://msdn.microsoft.com/en-us/library/aa393042(VS.85).aspx" rel="noreferrer">RegistryValueChangeEvent</a> in a C# service.</p>
  
  <p>I need an event handler that gets triggered each time any one of a set of registry values is changed.  I want behavior similar to the <a href="http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx" rel="noreferrer">FileSystemWatcher</a> class's <a href="http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.changed.aspx" rel="noreferrer">Changed</a> event, but for registry values.</p>
  
  <p>If there's some other technique I could use to accomplish the same task, I'd appreciate that as well.  My minimum requirement is that it be a better solution than what I have now: polling every 20 seconds and comparing the registry value with the last result. </p>
  
  <p>Please provide example code in your answer.  If I can get an example for watching just one registry value, that would be fine.</p>
  
  <p>I need a solution in .Net 2.0</p>
  
  <p>Thanks.</p>