读取注册表键值对的C#代码
程序员文章站
2024-01-18 10:55:04
...
using (RegistryKey keyRun = Registry.LocalMachine.OpenSubKey(@”Software\Microsoft\Windows\CurrentVersion\Run”)) { foreach (string valueName in keyRun.GetValueNames()) { Console.WriteLine(“Name: {0}\tValue: {1}”, valueName, keyRun.GetValue(valueName)); } }