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. Reading and Writing Reg_Binary

Reading and Writing Reg_Binary

Scheduled Pinned Locked Moved C#
windows-adminhelptutorial
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
    sriharichowdary
    wrote on last edited by
    #1

    I want to read and edit one of the values in Registry with REG_BINARY Format. How to read it. can any one help me out regarding this Please... It s Urgent......... :)

    C T 2 Replies Last reply
    0
    • S sriharichowdary

      I want to read and edit one of the values in Registry with REG_BINARY Format. How to read it. can any one help me out regarding this Please... It s Urgent......... :)

      C Offline
      C Offline
      Covean
      wrote on last edited by
      #2

      If it would be that urgent, I would put this question to google. (I used 3 words of your question with google and the first 3 entries hit!)

      Greetings Covean

      1 Reply Last reply
      0
      • S sriharichowdary

        I want to read and edit one of the values in Registry with REG_BINARY Format. How to read it. can any one help me out regarding this Please... It s Urgent......... :)

        T Offline
        T Offline
        The Man from U N C L E
        wrote on last edited by
        #3

        Reading and writing values in the registry is the same regardless of the format. In the case of REG_BINARY the returned object is of type byte[]. The following code would convert that to a string. You would reverse the process to write it back.

        RegistryKey regKey3 = Registry.CurrentUser;
        RegistryKey regSub3 = regKey3.OpenSubKey("Software or whatever");

        byte[] ans = (byte[])regSub3.GetValue("Value I need");
        string sString = System.Text.Encoding.ASCII.GetString(ans);
        string [] sArray = sString.Split('\0');
        sString = "";
        foreach (string s in sArray)
        {
        sString += s;
        }

        Now sString should have your string from the reg_binary ready for processing.

        If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

        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