c 操作注册表的问题!请高人看看
yjje 2010-07-29 11:39:28 #include <stdio.h>
#include <windows.h>
HKEY hkey;
DWORD temp = 0;
char SubKeyName[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";
if (RegOpenKeyEx(HKEY_CURRENT_USER,SubKeyName,0,KEY_ALL_ACCESS,&hkey) == ERROR_SUCCESS)
{
RegSetValueEx(hkey,"DnsCacheEnabled",0,REG_DWORD,(LPBYTE)&temp,sizeof(DWORD));
RegSetValueEx(hkey,"DnsCacheTimeout",0,REG_DWORD,(LPBYTE)&temp,sizeof(DWORD));
RegSetValueEx(hkey,"ServerInfoTimeOut",0,REG_DWORD,(LPBYTE)&temp,sizeof(DWORD));
RegCloseKey(hkey);
}
上面代码主要想在 Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings
下面建 3 个 DWORD 类型的值。
可是编译老是过去不,请大家帮忙看看,问题错在那里?