如何得到系统的开关机时间(在WIN2K下)??? 可以看看这样行不行. 看系统进程(如Service等)的启动时间. 用GetProcessTimes API 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 #include <windows.h>#include <stdio.h>#define SystemTimeInformation 3typedef struct _SYSTEM_TIME_INFORMATION{ LARGE_INTEGER liKeBootTime; LARGE_INTEGER liKeSystemTime; LARGE_INTEGER liExpTimeZoneBias; ULONG uCurrentTimeZoneId; DWORD dwReserved;} SYSTEM_TIME_INFORMATION;typedef LONG (WINAPI *PROCNTQSI)(UINT,PVOID,ULONG,PULONG);PROCNTQSI NtQuerySystemInformation;void main(void){ SYSTEM_TIME_INFORMATION Sti; LONG status; FILETIME ftSystemBoot; SYSTEMTIME stSystemBoot; NtQuerySystemInformation = (PROCNTQSI)GetProcAddress( GetModuleHandle("ntdll"), "NtQuerySystemInformation" ); if (!NtQuerySystemInformation) return; status = NtQuerySystemInformation(SystemTimeInformation,&Sti,sizeof(Sti),0); if (status!=NO_ERROR) return; ftSystemBoot = *(FILETIME *)&(Sti.liKeBootTime); FileTimeToLocalFileTime(&ftSystemBoot,&ftSystemBoot); FileTimeToSystemTime(&ftSystemBoot,&stSystemBoot); printf("Date: %02d-%02d-%04d\nTime: %02d:%02d:%02d\n", stSystemBoot.wMonth,stSystemBoot.wDay,stSystemBoot.wYear, stSystemBoot.wHour,stSystemBoot.wMinute,stSystemBoot.wSecond);} A(x1,y1),B(x2,y2),C(x,y),现在要求C到AB两点的垂点的坐标? CMFCMenuBar 更新菜单和菜单项的字串 文件读取乱码 不同对话框的控件是否可以用相同的ID? 想做一个软件,模拟电路分析!分不是问题! 很菜的问题! 在socket 中,send()后getlasterror()返回的值为10038,谁能告诉是什么错误吗? 在VC中有没有象VB中的DoEvents()那样的函数 救命啦,简单问题,多线程。 大家帮忙看看对不对? 如何得到系统的开关机时间(在WIN2K下)?? 我想要跳槽了,大家帮我出出主意!
#include <stdio.h>#define SystemTimeInformation 3typedef struct _SYSTEM_TIME_INFORMATION
{
LARGE_INTEGER liKeBootTime;
LARGE_INTEGER liKeSystemTime;
LARGE_INTEGER liExpTimeZoneBias;
ULONG uCurrentTimeZoneId;
DWORD dwReserved;
} SYSTEM_TIME_INFORMATION;
typedef LONG (WINAPI *PROCNTQSI)(UINT,PVOID,ULONG,PULONG);
PROCNTQSI NtQuerySystemInformation;
void main(void)
{
SYSTEM_TIME_INFORMATION Sti;
LONG status;
FILETIME ftSystemBoot;
SYSTEMTIME stSystemBoot; NtQuerySystemInformation = (PROCNTQSI)GetProcAddress(
GetModuleHandle("ntdll"),
"NtQuerySystemInformation"
); if (!NtQuerySystemInformation)
return; status = NtQuerySystemInformation(SystemTimeInformation,&Sti,sizeof(Sti),0);
if (status!=NO_ERROR)
return; ftSystemBoot = *(FILETIME *)&(Sti.liKeBootTime); FileTimeToLocalFileTime(&ftSystemBoot,&ftSystemBoot);
FileTimeToSystemTime(&ftSystemBoot,&stSystemBoot); printf("Date: %02d-%02d-%04d\nTime: %02d:%02d:%02d\n",
stSystemBoot.wMonth,stSystemBoot.wDay,stSystemBoot.wYear,
stSystemBoot.wHour,stSystemBoot.wMinute,stSystemBoot.wSecond);
}