如何通过 C# 代码检查注册表值是否存在?这是我的代码,我想要检查“Start”是否存在。
public static bool checkMachineType()
{
RegistryKey winLogonKey = Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\services\pcmcia", true);
string currentKey= winLogonKey.GetValue("Start").ToString();
if (currentKey == "0")
return (false);
return (true);
}