标签:try har arp window 名称 oca cli pen pre
实现效果:

知识运用:
RegistryKey类的GetSubKeyNames方法
public string[] GetSubKeyNames() //j检索用来包含 所有子项名称的字符串数组
实现代码:
private void button1_Click(object sender, EventArgs e)
{
try
{
RegistryKey regMain = Registry.LocalMachine;
RegistryKey regChild = regMain.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall");
foreach(string s in regChild.GetSubKeyNames())
{
if (s.Substring(0, 1) != "{")
listBox1.Items.Add(s);
}
}
catch (Exception ex)
{ MessageBox.Show(ex.Message); }
}
标签:try har arp window 名称 oca cli pen pre
原文地址:https://www.cnblogs.com/feiyucha/p/10332014.html