标签: c# windows-7 windows-10 shutdown
我有一个小程序,可以检测操作系统的上次关机事件。 我使用了来自这里的aplyied回答的代码:
Get the date-time of last windows shutdown event using .NET
工作正常,但在Windows 7中。 现在我迁移到了Windows 10,这里关闭事件的DateTime不正确保存。 而不是今天,我提前1个月和4天。 为什么这样?为什么注册表编辑器中的这个DateTime存储错误? Windows 7和10之间有什么区别?
UPD: 在事件查看器中发现奇怪的事情,存储错误的系统关闭事件: