回复:请大家来测试一下这个小软件
以下是这里面的代码:
if(OsVer.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS) //Win2k or later
{
CS_SystemFile = path;
CS_SystemFile += "\\System32\\CMD.EXE";
}
else
{
CS_SystemFile = path;
CS_SystemFile += "\\SYSTEM.DAT";
}
HANDLE hFile;
hFile = CreateFile(CS_SystemFile,GENERIC_READ,
FILE_SHARE_READ,NULL,
OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
if(hFile != INVALID_HANDLE_VALUE)
{
GetFileTime(hFile,&CFt,&CFw,&CFa);
FileTimeToSystemTime(&CFt,&sysTime); //Get File Created Time
CS_Dis.Format("%d年%d月%d日",
sysTime.wYear,sysTime.wMonth,sysTime.wDay);
SetDlgItemText(IDC_STATIC_INSTALL,CS_Dis);
}
else
{
SetDlgItemText(IDC_STATIC_INSTALL,"不能取得系统安装时间 :(");
}