Read REG_BINARY Value into its string equalent - 010307

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vighnesh

    #1

    Read REG_BINARY Value into its string equalent - 010307

    Hi Folks

    Greetings to you all. I am dealing with a project ( windows application ) in
    which I have to read the REG_BINARY value from the Registry and get its
    string equalent ( the ASCII text value ). Can anyone please suggest me how
    can I achieve that in VB/C#.NET.

    Thanking you in advance.

    Regards
    Vighneswar


  • Mattias Sjögren

    #2
    Re: Read REG_BINARY Value into its string equalent - 010307

    >Greetings to you all. I am dealing with a project ( windows application ) in
    >which I have to read the REG_BINARY value from the Registry and get its
    >string equalent ( the ASCII text value ).
    Well there are multiple ways to convert a byte array to a string,
    depending on which representation you want. But if you're saying that
    the data is ASCII encoded text, then
    System.Text.Enc oding.ASCII.Get String() should do it.


    Mattias

    --
    Mattias Sjögren [C# MVP] mattias @ mvps.org
    http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
    Please reply only to the newsgroup.

    Comment

    • vighnesh

      #3
      Re: Read REG_BINARY Value into its string equalent - 010307

      Hi Mattias

      Thank you very much for your reply. Its my gesture that the REG_BINARY is
      ASCII encoded text. Can you please let me know how to know the encoding of
      REG_BINARY value. The System.Encoding .ASCII.GetStrin g() didn't work for me.

      Thanking you in advance.
      Regards
      Vighneswar

      "Mattias Sjögren" <mattias.dont.w ant.spam@mvps.o rgwrote in message
      news:e02zmVEXHH A.3568@TK2MSFTN GP06.phx.gbl...
      Greetings to you all. I am dealing with a project ( windows application )
      in
      >>which I have to read the REG_BINARY value from the Registry and get its
      >>string equalent ( the ASCII text value ).
      >
      Well there are multiple ways to convert a byte array to a string,
      depending on which representation you want. But if you're saying that
      the data is ASCII encoded text, then
      System.Text.Enc oding.ASCII.Get String() should do it.
      >
      >
      Mattias
      >
      --
      Mattias Sjögren [C# MVP] mattias @ mvps.org
      http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
      Please reply only to the newsgroup.

      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: Read REG_BINARY Value into its string equalent - 010307

        vighnesh <vighnesh@nanna computers.comwr ote:
        Thank you very much for your reply. Its my gesture that the REG_BINARY is
        ASCII encoded text.
        No, REG_BINARY is arbitrary binary data.
        Can you please let me know how to know the encoding of
        REG_BINARY value. The System.Encoding .ASCII.GetStrin g() didn't work for me.
        In that case the binary data you're trying to decode isn't just an
        ASCII-encoded string.

        Now, you could convert the binary data to its hex representation, if
        that would be useful - but without more information about what you're
        trying to do (i.e. what the data really is), it's hard to say exactly
        how you should do it.

        --
        Jon Skeet - <skeet@pobox.co m>
        http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
        If replying to the group, please do not mail me too

        Comment

        • vighnesh

          #5
          Re: Read REG_BINARY Value into its string equalent - 010307

          Hi Jon

          Thank you very much for your reply. Here what I am trying to do is, to get
          the start menu programs list from the registry location

          "HKEY_CURRENT_U SER\Software\Mi crosoft\Windows \Current Version\Explore r\Menu
          Order\Start Menu\Programs"

          Here for each start menu program I have to retrieve its "Order" value which
          in REG_BINARY and convert that into normal text. I hope you understood what
          I am trying to do. Please assist me in getting this solved.

          Thanking you in advance.

          Regards
          Vighneswar
          "Jon Skeet [C# MVP]" <skeet@pobox.co mwrote in message
          news:MPG.205879 67fd4865198d946 @msnews.microso ft.com...
          vighnesh <vighnesh@nanna computers.comwr ote:
          >Thank you very much for your reply. Its my gesture that the REG_BINARY is
          >ASCII encoded text.
          >
          No, REG_BINARY is arbitrary binary data.
          >
          >Can you please let me know how to know the encoding of
          >REG_BINARY value. The System.Encoding .ASCII.GetStrin g() didn't work for
          >me.
          >
          In that case the binary data you're trying to decode isn't just an
          ASCII-encoded string.
          >
          Now, you could convert the binary data to its hex representation, if
          that would be useful - but without more information about what you're
          trying to do (i.e. what the data really is), it's hard to say exactly
          how you should do it.
          >
          --
          Jon Skeet - <skeet@pobox.co m>
          http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
          If replying to the group, please do not mail me too

          Comment

          • mpetrotta@gmail.com

            #6
            Re: Read REG_BINARY Value into its string equalent - 010307

            On Mar 7, 3:41 am, "vighnesh" <vighn...@nanna computers.comwr ote:
            >
            Thank you very much for your reply. Here what I am trying to do is, to get
            the start menu programs list from the registry location
            >
            "HKEY_CURRENT_U SER\Software\Mi crosoft\Windows \Current Version\Explore r\Menu
            Order\Start Menu\Programs"
            >
            Here for each start menu program I have to retrieve its "Order" value which
            in REG_BINARY and convert that into normal text. I hope you understood what
            I am trying to do. Please assist me in getting this solved.
            Yeesh. Doesn't look easy, from what I've found online (search Google
            for that registry key). Out of curiosity, why do you want to retrieve
            that data?

            Michael

            Comment

            • adasdas

              #7
              Re: Read REG_BINARY Value into its string equalent - 0 ...


              ---
              Posted via DotNetSlackers. com

              Comment

              Working...