First of all, it looks like you're missing something important in programming. There is no such thing as "Hex values" or "decimal values". There are values of different integer types and there are strings. Hex or decimal or binary can be different representation if integer values in the string forms. A binary string representation is not really binary in the sense that it uses one character ('0' or '1') per bit, and this character takes 1 or 2 bytes, depending on encoding.
You can access Windows Registry using the class
Microsoft.Win32.Registry
. I don't think anyone would be interested looking for correspondence between VB6 run-time and this class. And I don't think you even need it. Just read this and related topics:
http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx[
^].
Please understand: this class is not a part of standard library (part of .NET libraries are standardized by ECMA and ISO); also the use of Windows Registry is completely discouraged. Using the Registry by an application is really a bad idea. Moreover, if you use standard libraries only (and some non-standard ones, such as
System.Windows.Forms
) your code can work on many platforms, such as Mac, Linux and many more — via Mono (
http://en.wikipedia.org/wiki/Mono_(software)[
^]). If you use Registry — forget it! — your software is not really portable between different Windows system.
So, there is only one good way — stop using Registry. (Well, you already have my answer on using Registry anyway, so this is a step forward.) What to use instead? Well, one thing is
Configuration
, see
http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx[
^], another one — settings, see
http://msdn.microsoft.com/en-us/library/aa730869(v=vs.80).aspx[
^]. Most general advice on using and persisting (writeable) application-specific data is this: you need to use the method
System.Environment.GetFolderPath(System.Environment.SpecialFolder)
to get write path where you want to store your data. Most typically, you would use
System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData)
. See
System.Environment.SpecialFolder
,
http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx[
^] for other folders,
System.Environment.GetFolderPath
,
http://msdn.microsoft.com/en-us/library/14tx8hby.aspx[
^] for more information.
—SA