How to write and read from Registry in C#?
Local data storage in client machine developer use registry.this store small data like application settings.It can modify manually to edit in regedit . In this post we learn about read and write in registry.Registry is one structure of data by link or keys and sub keys. For write in registry need to create key or path where want to write.so if we have key then open it and not then create it. RegistryKey Newkey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\NewKey"); Registry.CurrentUser => "\HKEY_CURRENT_USER\" @"SOFTWARE\KeyName" => this key is located on "HKEY_CURRENT_USER\Software\NewKey" CreateSubKey() => create new key RegistryKey Key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Key",true); OpenSubKey() => opne allready exist Key OpenSubKey(@"SOFTWARE\Key",true) => OPen "HKEY_CURRENT_USER\SOFTWARE\Key" and second parameter "True" is allow write keys otherwise not permit ...