Editing the Registry
-
Hi all, My application needs me to create a CSLID in the registry, in order for it to work! I usually do this manually by editing the registry. I'd like the application to do this automatically by itself. I want it to automatically create a new CSLID under the key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\ CurrentVersion\Explorer\Browser Helper Objects in the registry. How would i code this in C# ??? Any help would be much appreciated, code examples or reference sites. Thanx
-
Hi all, My application needs me to create a CSLID in the registry, in order for it to work! I usually do this manually by editing the registry. I'd like the application to do this automatically by itself. I want it to automatically create a new CSLID under the key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\ CurrentVersion\Explorer\Browser Helper Objects in the registry. How would i code this in C# ??? Any help would be much appreciated, code examples or reference sites. Thanx
-
Hi all, My application needs me to create a CSLID in the registry, in order for it to work! I usually do this manually by editing the registry. I'd like the application to do this automatically by itself. I want it to automatically create a new CSLID under the key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\ CurrentVersion\Explorer\Browser Helper Objects in the registry. How would i code this in C# ??? Any help would be much appreciated, code examples or reference sites. Thanx
(1) See the MSDN documentation on Uuidgen.exe fo learning how you can geneate a GU/UU/CLS ID. (2) Here is the code to put it in registry a. Create the key hierarchy using this code public void CheckRegistryKey(string sKeyname) { RegistryKey oRegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\" + sKeyname, true); if(oRegistryKey==null) { oRegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE", true); oRegistryKey.CreateSubKey(sKeyname); } } b. Set the string clsid value using this public void SetStringValue(string sKeyname, string sValueName, string sValue) { RegistryKey oRegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\" + sKeyname, true); if(oRegistryKey==null) { oRegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE", true); oRegistryKey.CreateSubKey(sKeyname); } oRegistryKey.SetValue(sValueName, sValue); }