Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Editing the Registry

Editing the Registry

Scheduled Pinned Locked Moved C#
csharpwindows-adminhelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stuggo
    wrote on last edited by
    #1

    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

    B S 2 Replies Last reply
    0
    • S Stuggo

      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

      B Offline
      B Offline
      BrcKcc
      wrote on last edited by
      #2

      Look at the Microsoft.Win32.Registry class. This has all the functionality you need to create keys and modify them. BRCKCC

      1 Reply Last reply
      0
      • S Stuggo

        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

        S Offline
        S Offline
        Salil Khedkar
        wrote on last edited by
        #3

        (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); }

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups