How can I retrieve a binary value from the registry?

  • Thread starter Thread starter ForestDemon
  • Start date Start date
F

ForestDemon

i'm able to use the GetValue() function for string usage/manipulation,
but i can't figure out how to read/write a binary value to/from a key.

any help is greatly appreciated...thanks folks!
 
i'm able to use the GetValue() function for string usage/manipulation,
but i can't figure out how to read/write a binary value to/from a key.

Same way, but you retrieve or pass in a byte array instead of a
string.



Mattias
 
The binary values are read and written as byte arrays; e.g

Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine;

object res = rk.GetValue("a");

byte[] mybinaryvalue = (byte[])res;

i'm able to use the GetValue() function for string usage/manipulation,
 
thanks to those who replied...this worked out for me.

i truly appreciate the input!

The binary values are read and written as byte arrays; e.g

Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine;

object res = rk.GetValue("a");

byte[] mybinaryvalue = (byte[])res;

i'm able to use the GetValue() function for string usage/manipulation,

but i can't figure out how to read/write a binary value to/from a key.


any help is greatly appreciated...thanks folks!
 

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

Back
Top