I am writing a value into registry of my Windows.Now as per my requirement i have to read it without specifying the path name where it has been saved but i am not getting how to retrieve it. Here is the code to write ..
Microsoft.Win32.RegistryKey exampleRegistryKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("ExampleTest");
exampleRegistryKey.SetValue("Conn", "Connection Test");
exampleRegistryKey.Close();
Please help me how to read this key. Thanks..
public static string PathName
{
get
{
using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\ExampleTest"))
{
return (string)registryKey.GetValue("Conn");
}
}
}