可以看看这样行不行. 
看系统进程(如Service等)的启动时间. 
用GetProcessTimes API

解决方案 »

  1.   

    #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);
    }