public bool IsValueSet(string key, string value, out string stringvalue) { RegistryPolRecord record = SearchRecord(key, value); stringvalue = null; if (record == null) { return(false); } if (record.Type != RegistryValueKind.String) { return(false); } stringvalue = UnicodeEncoding.Unicode.GetString(record.ByteValue).TrimEnd('\0'); return(true); }
public bool IsValueSet(string key, string value, out int data) { RegistryPolRecord record = SearchRecord(key, value); data = 0; if (record == null) { return(false); } if (record.Type != RegistryValueKind.DWord) { return(false); } if (record.ByteValue.Length != 4) { return(false); } data = (int)BitConverter.ToUInt32(record.ByteValue, 0); return(true); }