473,624 Members | 2,453 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to store binary data in registry?

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
Nov 20 '05 #1
4 2450
Hi Wolfgang
need to store binary data in the registry.


did you try to pass a Byte-Array to SetValue:
http://msdn.microsoft.com/library/en...ValueTopic.asp


--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/
Nov 20 '05 #2
Are you sure the registry is the proper place for this data? Look at
Application.Com monAppDataPath or Application.Use rAppDataPath.

"Wolfgang Kaml" <ms@no-spam.kaml.com> wrote in message news:<ew******* *******@TK2MSFT NGP11.phx.gbl>. ..
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

Nov 20 '05 #3
Hi Wolfgang,

I agree with Thomas's suggestion.
You may take a look at the link below.
http://groups.google.com/groups?q=bi...en&lr=&ie=UTF-
8&selm=uiR74zQR CHA.2252%40tkms ftngp11&rnum=16
http://groups.google.com/groups?q=bi...en&lr=&ie=UTF-
8&selm=u5dE5z5d DHA.1832%40TK2M SFTNGP09.phx.gb l&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.

Nov 20 '05 #4
Thanks for the hint. It works just fine. I'm using it to store an RSA
encrypted registration key.
"Thomas Scheidegger [MVP]" <sp************ @swissonline.ch > wrote in message
news:em******** ******@tk2msftn gp13.phx.gbl...
Hi Wolfgang
> need to store binary data in the registry.
did you try to pass a Byte-Array to SetValue:

http://msdn.microsoft.com/library/en...ValueTopic.asp

--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/

Nov 20 '05 #5

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

Similar topics

22
2665
by: Tony Houghton | last post by:
I'm using pygame to write a game called Bombz which needs to save some data in a directory associated with it. In Unix/Linux I'd probably use "~/.bombz", in Windows something like "C:\Documents And Settings\<user>\Applicacation Data\Bombz". There are plenty of messages in the archives for this group about how to find the correct location in Windows, but what about Mac OS? There I don't know the correct location for this sort of thing at...
8
10639
by: Saradhi | last post by:
Can any one put me a piece of code to write binary data into Registry?
6
16011
by: John Hoffman | last post by:
Reading registry: .... RegistryKey rksub = rkey.OpenSubKey(s); String valstr = rksub.GetValueNames(); foreach (String vs in valstr) { String vstr = rksub.GetValue(vs).ToString(); OR String vstr = rksub.GetValue(vs);
0
1130
by: Sharon McCarty | last post by:
Hi Everyone, I have a managed C++ web service and I'm trying to access the registry key that contains a binary data. Can someone tell me how to convert object __gc* to byte? I've got some code: -----------------------------------------------------------------------
5
4504
by: Guadala Harry | last post by:
What are my options for *securely* storing/retrieving the ID and password used by an ASP.NET application for accessing a SQL Server (using SQL Server authentication)? Please note that this ID and password would be different than the one the user enters for ASP.NET forms authentication. The ID/password in question is used by the application, itself, for accessing the SQL Server. Thanks in advance.
1
5827
by: Steve Bostedor | last post by:
I'm trying to use the RegistryKey to write a hex number into the registry as a binary type. I know see that in DotNet, the RegistryKey tries to interprate what registry type to create depending on the type of structure the variable was dimmed as. I dimmed it as a character array, then dumped each value into that character array, then wrote it to the registry and sure enough, it created a binary entry of it .... but .... The problem...
3
4432
by: piotrek | last post by:
Hi I would like to ask you a question. Ian creating app. that download from server directory structure ( whole tree ) and those data are placed in proper places into my treeview control. I decided that the most effective way would be : When i connect to the server once, I download the list and disconnect, instead of connecting every time i go, to the lower node in my tree hierarhy. Thus i have a problem - how to store data.
10
6813
by: Mike9900 | last post by:
Hello, I would like to store application expiration date in a file and store that file in a secure place, so the application can access the file for all the users on that computer. IsolatedStorage is a good technique but it is for the each user only and is not machine level. Registry is not good because the user may not have access permission. Application directory is not good because the file could be deleted and so the...
0
230
by: Brian Vanderburg II | last post by:
Lance Gamet wrote: Lance Gamet wrote: One way I've just started to use it to create a utility function to return the location of the user data folder, depending on the operating system: import os, sys def GetUserDataDirectory(): dir = None
0
8240
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8625
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8482
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7168
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6111
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5565
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2610
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.