Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Enumérer les clés du registre

Modifier,ou,créer,une,source,d'événement
{filelink=15695}

using Microsoft.Win32;
 
  class EnumererLesCleRegistre
  {
    static void Main(string[] args)
    {
      RegistryKey cléRegistre=Registry.LocalMachine;
      cléRegistre=cléRegistre.OpenSubKey(@""SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"");
      String [] sousClé = cléRegistre.GetSubKeyNames();
      foreach (String elem in sousClé) {
        RegistryKey UninstallKey=Registry.LocalMachine;
        UninstallKey=UninstallKey.OpenSubKey (@""SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"" + elem);
        Object oValue=UninstallKey.GetValue(""DisplayName"");
        Console.WriteLine(oValue.ToString());
      }
    }
  }

No comments yet.

Leave a Comment