using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Microsoft.Win32; namespace ImageFile { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { foreach (string keys in Registry.LocalMachine.OpenSubKey(@"SOFTWARE/Microsoft/Windows NT/CurrentVersion/Image File Execution Options").GetSubKeyNames()) { object isRobkey=Registry.GetValue(@"HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Image File Execution Options/"+keys,"Debugger",null); if (isRobkey != null) { ListViewItem lvi = new ListViewItem(new string[] { keys, isRobkey.ToString() }); listView1.Items.Add(lvi); } } label1.Text = "共"+listView1.Items.Count+"项"; } } }