public string GetRegistryValue(RegistryKey regKey, string property) { if (regKey != null) { if (regKey.GetValue(property) == null) return ""; return regKey.GetValue(property).ToString(); } return ""; } }