一、 准备工作
1. 概念
Windows 系统使用注册表来存储系统和应用程序配置数据。很多系统和应用程序重要的 配置的信息都存储在注册表中。注册表是一种以树型结构组织的数据库。树的每一个节点称 作键(key),每个节点可以包含若干子键,键可以存储数据,存储的数据称作键值。一个键 无论其是否有子键,都可以有键值。一个键可以有很多个键值,每个键值都有一个名字,包 含若干数据,所包含的数据类型可以有很多种。
注册表键值类型
Value |
Type |
REG_BINARY |
Binary data in any form. |
REG_DWORD |
A 32-bit number. |
REG_DWORD_LITTLE_ENDIAN |
A 32-bit number in little-endian format. |
REG_DWORD_BIG_ENDIAN |
A 32-bit number in big-endian format. |
REG_EXPAND_SZ |
A null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It will be a Unicode or ANSI string depending on whether you use the Unicode or ANSI functions. To expand the environment variable references, use the ExpandEnvironmentStrings function. |
REG_LINK |
A null-terminated Unicode string that contains the target path of a symbolic link that was created by calling the RegCreateKeyEx function with REG_OPTION_CREATE_LINK. |
REG_MULTI_SZ |
A sequence of null-terminated strings, terminated by an empty string (\0). The following is an example: |