How to store binary data in registry?

  • Thread starter Thread starter Wolfgang Kaml
  • Start date Start date
W

Wolfgang Kaml

I came accross the need to store binary data in the registry. The binary
data to be saved is kept within a string in the code segment. If I write
that string to a registry, not all of the data is kept. There are some
certain chars included within that string, which the registry SetValue
function cannot handle and therefore the string is being cut off.
Instead of storing that string with special characters as a string in the
registry, I am wondering of how I can store that string as binary data in
the registry.
Has anybody been trying to attampt that task before? Can I use a Binary
array and pass that as the object through the SetValue funtion?
Any ideas that will work would be very helpful!

Thank you,
Wolfgang
 
Are you sure the registry is the proper place for this data? Look at
Application.CommonAppDataPath or Application.UserAppDataPath.
 
Hi Wolfgang,

I agree with Thomas's suggestion.
You may take a look at the link below.
http://groups.google.com/groups?q=binary+SetValue&start=10&hl=en&lr=&ie=UTF-
8&selm=uiR74zQRCHA.2252%40tkmsftngp11&rnum=16
http://groups.google.com/groups?q=binary+SetValue&start=10&hl=en&lr=&ie=UTF-
8&selm=u5dE5z5dDHA.1832%40TK2MSFTNGP09.phx.gbl&rnum=15


If you have any concern on this issue, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Thanks for the hint. It works just fine. I'm using it to store an RSA
encrypted registration key.
 
Back
Top