The ReadKeyRegistry method reads a value from a given location in the registry, and assigns it to the Key object.
Hive
The Hive argument is an enumerated constant, which defines the following five hexidecimal values:
HKeyClassesRoot
=
0x80000000
HKeyCurrentUser
=
0x80000001
HKeyLocalMachine
=
0x80000002
HKeyUsers
=
0x80000003
HKeyCurrentConfig
=
0x80000005
As the name of the argument suggests, each of these values corresponds to a particular hive within the registry.
On Win32 platforms, the registry is a hierarchically structured database which contains information pertinent
to the configuration of both the operating system and the software installed on the machine.
This database is conceptually organized as a tree, with each node under the root indicating
a major division of the database.
The hives represent these immediate children of the registry root node, and provide the base for the pathnames of any subkeys that lie under them.
KeyName
The KeyName argument is the name of the registry subkey that contains the cipher key value.
This name takes the form of a pathname,
with the sections of the name representing subkeys, rather than folders. Thus, the name "SOFTWARE\WebSite"
indicates the "WebSite" subkey, which is a child of the "SOFTWARE" subkey, which is, in turn, the child of a
hive node within the registry. Note that if the subkey specified by the KeyName argument does not
exist, the method will throw an error.
ValueName
The ValueName argument indicates the name of the value that holds the desired cipher key data.
Each key in the registry contains zero or more
values, which actually hold the data relavent to the subkey that owns them.
Thus, when the ReadKeyRegistry
method is called, the Key object will attempt to open the subkey indicated by the KeyName argument, and read the data stored in the value whose name is given by the ValueName argument.
Note that if this value does not exist, the method will throw an error.
Example: <%
Function UpdateCardNumber(lngUserID, strCardNumber)
If lngUserID < 1 Or strCardNumber = "" Then
UpdateCardNumber = False
Exit Function
End If