实现效果:

知识运用:
Registry类的CurrentConfig字段 //包含有关用户特定的硬件的配置信息
private void Form1_Load(object sender, EventArgs e)
{
this.TVRegedit.Nodes.Clear(); //清空所有树节点
RegistryKey rKey = Registry.CurrentConfig; //读取HKEY_CURRENT_CONFIG基项
TreeNode Tnode = new TreeNode("HKEY_CURRENT_CONFIG");//创建树节点
foreach (string s in rKey.GetSubKeyNames()) //遍历基项下的子项
{
Tnode.Nodes.Add(s); //添加到基项节点
}
TVRegedit.Nodes.Add(Tnode); //添加到控件进行显示
}