Click here to Skip to main content
15,886,362 members
Articles / Programming Languages / C#

Read Registry using C#

Rate me:
Please Sign up or sign in to vote.
3.33/5 (3 votes)
5 Dec 2011CPOL 39.6K   8  
How to read a key from the Windows Registry.

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
7 Dec 2011morningstar1710
This is the code that I use:For lookup:RegistryKey rkn = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Test");dwResult = rkn.GetValue("Preferences");For update:RegistryKey rkn = Registry.LocalMachine.CreateSubKey(szKeyPath); dwResult = rkn.ValueCount;rkn.SetValue(szKey,...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead Erls Corporation
India India
I am Dinesh kumar Choudhary by Name, a software Designer and Developer by Work, a Indian Hindu by Religion, Co-Founder of DSFoundation located at http://dsfoundation.wordpress.com by profession, a Loving husband and a Caring Father by Relation.

I have a blog Website at http://dennosecqtinstien.wordpress.com. DSFoundation is the Autonomous body to serve for the management of Local shops located at New Delhi, India. Now a days DSFoundation and its subsidiaries are managed by Erls Corporation, an Another initiative by me and my colleagues, in which i am the another CO-Founder of the Organization. Erls Corporation can be located at http:erlsindia.co.in

Comments and Discussions