= 읽기 =
DWORD dwType = REG_SZ;
DWORD dwSize = 128;
HKEY hKey;
TCHAR szBuffer[128] = {'\0' ,};
LONG lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE , "SOFTWARE\\TestProg" , 0 , KEY_READ , &hKey);
if(ERROR_SUCCESS == lResult)
{
RegQueryValueEx(hKey , "Date" , NULL , &dwType , (LPBYTE)szBuffer , &dwSize);
}
= 쓰기 =
SYSTEMTIME stTime;
GetLocalTime(&stTime);
CString rInstalledDate;
rInstalledDate.Format("%d-%d-%d" , stTime.wYear , stTime.wMonth , stTime.wDay);
CRegKey RegKey;
RegKey.Create(HKEY_LOCAL_MACHINE , "SOFTWARE\\TestProg");
RegKey.SetValue(rInstalledDate , "Date");
RegKey.Close();
DWORD dwType = REG_SZ;
DWORD dwSize = 128;
HKEY hKey;
TCHAR szBuffer[128] = {'\0' ,};
LONG lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE , "SOFTWARE\\TestProg" , 0 , KEY_READ , &hKey);
if(ERROR_SUCCESS == lResult)
{
RegQueryValueEx(hKey , "Date" , NULL , &dwType , (LPBYTE)szBuffer , &dwSize);
}
= 쓰기 =
SYSTEMTIME stTime;
GetLocalTime(&stTime);
CString rInstalledDate;
rInstalledDate.Format("%d-%d-%d" , stTime.wYear , stTime.wMonth , stTime.wDay);
CRegKey RegKey;
RegKey.Create(HKEY_LOCAL_MACHINE , "SOFTWARE\\TestProg");
RegKey.SetValue(rInstalledDate , "Date");
RegKey.Close();
댓글
댓글 쓰기