如何获取Windows启动时间? [英] How to get Windows boot time?
本文介绍了如何获取Windows启动时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用一些WinAPI函数在C ++中获取Windows启动时间?我目前正在使用命令systeminfo,但我正在寻找一个更合适的解决方案。
How can I get Windows boot time in C++ with some WinAPI functions? I am currently using the command "systeminfo", but I'm looking for a more proper solution.
推荐答案
在任务管理器的工作,它使用 ZwQuerySystemInformation(SystemTimeOfDayInformation,...)
函数,它接收 SYSTEM_TIMEOFDAY_INFORMATION
结构。
I've checked at how Task Manager does it, and turns out it uses the ZwQuerySystemInformation(SystemTimeOfDayInformation, ...)
function, which receives the SYSTEM_TIMEOFDAY_INFORMATION
structure.
typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
LARGE_INTEGER BootTime;
LARGE_INTEGER CurrentTime;
LARGE_INTEGER TimeZoneBias;
ULONG TimeZoneId;
ULONG Reserved;
ULONGLONG BootTimeBias;
ULONGLONG SleepTimeBias;
} SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION;
BootTime
对于更多文档,我想 GetTickCount64
会做。
For something more documented, I think GetTickCount64
will do.
这篇关于如何获取Windows启动时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文