473,320 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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
Mar 1 '07 #1
6 3065
>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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Mar 1 '07 #2
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

"Mattias Sjögren" <ma********************@mvps.orgwrote in message
news:e0**************@TK2MSFTNGP06.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.Encoding.ASCII.GetString() 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.

Mar 7 '07 #3
vighnesh <vi******@nannacomputers.comwrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 7 '07 #4
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\Curr ent 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
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP***********************@msnews.microsoft.co m...
vighnesh <vi******@nannacomputers.comwrote:
>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.

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

Mar 7 '07 #5
On Mar 7, 3:41 am, "vighnesh" <vighn...@nannacomputers.comwrote:
>
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\Curr ent 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

Mar 7 '07 #6

---
Posted via DotNetSlackers.com
May 8 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
2
by: lastusernameleft | last post by:
What is the easiest .net method to read a REG_BINARY value from the registry? I'm using a ManagementClass from the System.Management namespace and can retrieve string values using...
1
by: Allen Lee | last post by:
The Problem was that when I wanted to use C# to write a REG_BINARY data to registry, it came to me that the method SetValue() of class RegistryKey cannot let me specify the type. What must I do if...
1
by: vkrasner | last post by:
It works with VS2003 and does not in VS2005: in VS2003 : string sMyvalue = ConfigurationSettings.AppSettings; in VS2005 (does not work!!) string sMyvalue = ConfigurationManager.AppSettings; ...
3
by: Programmer | last post by:
Hi all I wan't to know if i'm able to read mail from a mail server. My mail server is a pop3 server (UNIX) and i want to be able to get the mails from an aspx or an asmx. with out using external...
5
by: vighnesh | last post by:
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...
2
by: Srini | last post by:
Hi, Can anyone please tell me how to retrieve meaningful value from registry value in REG_Binary type? I tried to convert REG_Binary value to string using the following code.
0
by: martinmercy2001 | last post by:
Could any body help me with creating a ring buffer class using a string. use memory circular buffer not an IO buffer. just read, write and seek method. Read method should take anumber and return the...
0
by: sureshbabu640 | last post by:
Hi I am devloping one exiting vb project into vb.net.In vb project i seen checkbox events like got focus and lose focus but i did not find in vb.net. Now can any...
2
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi Is there any way to Read an INIFile from a string or Stream instead of a physical file ??? I want to read the INIFile into a string then store in a db but when I read the string from the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.