Read REG_BINARY Value into its string equalent - 010307

V

vighnesh

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
 
M

Mattias Sjögren

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.Encoding.ASCII.GetString() should do it.


Mattias
 
V

vighnesh

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.GetString() didn't work for me.

Thanking you in advance.
Regards
Vighneswar
 
J

Jon Skeet [C# MVP]

vighnesh said:
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.GetString() 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.
 
V

vighnesh

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_USER\Software\Microsoft\Windows\Current Version\Explorer\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
 
M

mpetrotta

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_USER\Software\Microsoft\Windows\Current Version\Explorer\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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top