title: c# IndexOf does not exist in current context
body: <p>I'm trying to use the following and can't wrap my head around why this IndexOf method isn't working.</p>
  
  <pre><code>foreach (string s in regKey.GetSubKeyNames())
          {
              RegistryKey sub = Registry.LocalMachine.OpenSubKey(string.Format(@"{0}\{1}", _UninstallKey64Bit, s), false);
  
              if (sub.ValueCount &gt; 0)
              {
                  values = sub.GetValueNames();
  
                  if (IndexOf(values, "DisplayName")  != -1)
                  {
                      string name = (sub.GetValue("DisplayName") != null) ? sub.GetValue("DisplayName").ToString() : string.Empty;
  
                      if (!string.IsNullOrEmpty(name) &amp;&amp; (name.ToLower() == appName.ToLower()))
                          if (IndexOf(values, "UninstallString") != -1)
                          {
                              uninstallValue = (sub.GetValue("UninstallString") != null) ? sub.GetValue("UninstallString").ToString() : string.Empty;
                              break;
                          }
                  }
              }
          }
  </code></pre>
  
  <p>Can anyone lend me a hand with this?</p>