1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
private static bool ValueExist(RegistryKey OurKey, string strValue)
{
string[] VN = OurKey.GetValueNames();
foreach (string v in VN)
{
string Val;
if (OurKey.GetValue(v) is byte[])
{
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
Val = enc.GetString((byte[])OurKey.GetValue(v));
}
else { Val = (string)OurKey.GetValue(v); }
if (Val == strValue)
{
return true;
}
}
return false;
}
|