//z 2012-5-3 16:51:44 PM IS2120@CSDN 如果欲修改值,打开时如下:
// RegistryKey skms = SoftwareKey.OpenSubKey(RegistryKeyName, true);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
namespace regEnum
{
class Program
{
static void Main(string[] args)
{
string regPath = @"Control Panel";
keyWalker walker = new keyWalker();
walker.enumerateKeysRecurse(regPath);
Console.ReadKey();
}
}
class keyWalker
{
public void enumerateKeysRecurse(string keyPath)
{
RegistryKey HKLM = Registry.CurrentUser;
RegistryKey RegKey = HKLM.OpenSubKey(keyPath);
string[] subKeys = RegKey.GetSubKeyNames();
foreach (string subKey in subKeys)
{
string fullPath = keyPath + "\\" + subKey;
this.enumerateKeysRecurse(fullPath);
Console.WriteLine(fullPath);
}
}
}
}
c# 注册表.代码示例.(迭代遍历注册表)[Demo]
最新推荐文章于 2024-05-16 16:02:03 发布