/// <summary> /// Reads the value/data pair from the NCache registry key. /// Automatically caters for wow64/win32. /// </summary> /// <param name="section">Section from which key is to be read.</param> /// <param name="key">Name of the value to be read.</param> /// <returns>Data of the value.</returns> public static string GetAppSetting(string section, string key) { if (!IsRunningAsWow64) { section = RegHelper.ROOT_KEY + section; } object tempVal = RegHelper.GetRegValue(section, key, 0); if (!(tempVal is string)) { return(Convert.ToString(tempVal)); } return((string)tempVal); }
/// <summary> /// Write the value to the NCache registry key after encrypting it. /// Automatically caters for wow64/win32. /// </summary> /// <param name="section">">Section from which key is to be read.</param> /// <param name="key">Name of the value to be write.</param> /// <param name="value">New value of key</param> public static void SetEncryptedAppSetting(string section, string key, string value) { section = RegHelper.ROOT_KEY + section; RegHelper.SetEncryptedRegValue(section, key, value); }
/// <summary> /// Write the value to the NCache registry key. /// Automatically caters for wow64/win32. /// </summary> /// <param name="section">">Section from which key is to be read.</param> /// <param name="key">Name of the value to be write.</param> /// <param name="value">New value of key</param> public static void SetAppSetting(string section, string key, string value, short prodId) { section = RegHelper.ROOT_KEY + section; RegHelper.SetRegValue(section, key, value, prodId); }
/// <summary> /// Get decrypted value from section. /// Automatically caters for wow64/win32. /// </summary> /// <param name="section">">Section from which key is to be read.</param> /// <param name="key">key</param> /// <returns>value retrieved</returns> public static string GetDecryptedAppSetting(string section, string key) { section = RegHelper.ROOT_KEY + section; return((string)RegHelper.GetDecryptedRegValue(section, key, 0)); }
static public string GetLicenseKey(short prodId) { return((string)RegHelper.GetRegValueInternal("UserInfo", "licensekey", prodId)); }