[Quote=引用 3 楼 llg84 的回复:]
引用 2 楼 pilixuanke 的回复:
Use GetLocalTime or GetSystemTime to retrieve the current date and time. There is only RTC run when system is suspended, and RTC will update the system time when waked up.
There is no safe way if user changed the system time frequently. You can combine GetTickCount & GetLocalTime to archive your goal, perhaps.
GetLocalTime or GetSystemTime只能获取到当前系统时间,这个时间跟开机没关系,所以应该还是不行,除非能在开机时就获取一个时间并存起来,但作为一个非开机自动运行的程序又做不到这一点。
[/Quote]
你可以在某个驱动或者内核里边等开机完成时获取当前的时间,然后AP通过访问这个时间进行比较
[Quote=引用 2 楼 pilixuanke 的回复:]
Use GetLocalTime or GetSystemTime to retrieve the current date and time. There is only RTC run when system is suspended, and RTC will update the system time when waked up.
There is no safe way if user changed the system time frequently. You can combine GetTickCount & GetLocalTime to archive your goal, perhaps.
[/Quote]
GetLocalTime or GetSystemTime只能获取到当前系统时间,这个时间跟开机没关系,所以应该还是不行,除非能在开机时就获取一个时间并存起来,但作为一个非开机自动运行的程序又做不到这一点。
Use GetLocalTime or GetSystemTime to retrieve the current date and time. There is only RTC run when system is suspended, and RTC will update the system time when waked up.
There is no safe way if user changed the system time frequently. You can combine GetTickCount & GetLocalTime to archive your goal, perhaps.
[Quote=引用 5 楼 veabol 的回复:]
引用 3 楼 llg84 的回复:
引用 2 楼 pilixuanke 的回复:
Use GetLocalTime or GetSystemTime to retrieve the current date and time. There is only RTC run when system is suspended, and RTC will update the system time when waked up.
There is no safe way if user changed the system time frequently. You can combine GetTickCount & GetLocalTime to archive your goal, perhaps.
GetLocalTime or GetSystemTime只能获取到当前系统时间,这个时间跟开机没关系,所以应该还是不行,除非能在开机时就获取一个时间并存起来,但作为一个非开机自动运行的程序又做不到这一点。