473,568 Members | 2,986 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
5 10834
>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.
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.GetStrin g() didn't work for me.

Thanking you in advance.
Regards
Vighneswar

"Mattias Sjögren" <ma************ ********@mvps.o rgwrote in message
news:e0******** ******@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.

Mar 7 '07 #3
vighnesh <vi******@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 - <sk***@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
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_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]" <sk***@pobox.co mwrote in message
news:MP******** *************** @msnews.microso ft.com...
vighnesh <vi******@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 - <sk***@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

Mar 7 '07 #5
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

Mar 7 '07 #6

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

Similar topics

1
6813
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 elements, attributes, ".", and "..", plus also the "" predicate format is supported - however, only one predicate per path step is supported, and expr must...
2
2615
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 GetMethodParameter("GetStringValue") but can't find the method for binary, the MSDN documentation is terrible and doesn't provide a list of possible parameters. any...
1
5141
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 I want to write a REG_BINARY data to registry? Thank you very much!
1
5330
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; Anybody able to give me idea how-to read by C# element which I add to the machine.config into the new single section?
6
3084
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 value ). Can anyone please suggest me how can I achieve that in VB/C#.NET. Thanking you in advance. Regards
2
4359
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
3851
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 string. write method should take a string. seek should take a number and return nuthing. use three member variables a buffer itself as a string,...
0
781
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 body help me what are the equalent events of checkbox got focus and lose focus events in vb.net ?
2
5318
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 db or save string to the db I don't want to have to copy the string to a file to use the WritePrivateProfileString and GetPrivateProfileString. Is...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.