I am developing a windows application in .NET framework, using C#. At the time of application installation I want to write into the registry a certain value. So I have two questions regarding this :
-
How can I execute a code for creating a registry entry at time of installation or there is some settings in the framework which allows us to do so ?
-
I don’t want to create a new node in the registry, can I use some common place anywhere, in the registry or an existing node where I can store my value without affecting the local system settings ?
Please help me out.
Thanks,
Bibhu
You can use the Microsoft.Win32.Registry class to read or write to the Windows registry.
http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx
It’s considered bad form to just drop data values into existing registry keys. You should create a key path identified by your company and/or application name and put your registry stuff there. This is a courtesy to the end user who may want to remove all your application cruft after they remove your application from their system.