vc++读取注册表,高分求助

来源:百度知道 编辑:UC知道 时间:2024/06/24 10:32:05
刚刚接触c++,现要急用个东西,麻烦那位给帮助下
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
#include <string.h>
char PlayerName[16] = "name";
DWORD PlayerLen = 0;
char DbgMsg[256];

把上面那个代码中的改成"name"注册表中[HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\String]
下的"userlocal"的值就可以了
在线等
刚才字打错,把代码中的"name"改成注册表中的值

我自己写的 你改一下就好了

也可以去我空间看看

http://blog.csdn.net/lijiawlm/archive/2009/06/04/4241729.aspx

# //将用户名 数据库地址保存到注册表
# bool CSetDataBase::SetDBValue(void)
# {
# UpdateData(TRUE);
#
# HKEY hKey , hKeySub;//定义有关的hKEY,在查询结束时要关闭
# DWORD dwType=REG_SZ; //定义读取数据类型
# LPCTSTR RegValueNameDB = "DBAdress";
# LPCTSTR RegValueNameUser = "User";
# LPCTSTR RegValueNamePWD = "Pwd";
# char content[256]; //所查询注册表键值的内容
# LPCTSTR RegSubKey = "Software\\Microsoft\\Windows NT\\CurrentVersion\\";
# DWORD dwLength = 256;
#
# LPCTSTR strDBAdr , strUserName , strPwd;
# strDBAdr = this->strDBPath;
# strUserName = thi