07-09-16, 05:36 PM
(07-09-16, 09:18 AM)أبو عمر كتب :شكرآ جزيلا
تأكد من مسار القيمة او المفتاح
PHP كود :
string keyName=@"HKEY_LOCAL_MACHINE\System\CurrentControlSet\services\pcmcia";
string valueName="Start";
if (Registry.GetValue(keyName, valueName, null) == null)
{
//code if key Not Exist
}
else
{
//code if key Exist
}
وهنا البحث عن مفتاح
PHP كود :
RegistryKey OurKey = Registry.LocalMachine;
OurKey = OurKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList", true);
foreach (string Keyname in OurKey.GetSubKeyNames())
{
RegistryKey key = OurKey.OpenSubKey(Keyname);
MessageBox.Show(key.GetValue("KEY_NAME").ToString()); // Replace KEY_NAME with what you're looking for
}
