Created
March 23, 2019 16:26
-
-
Save Ormadont/27a093ba40c775531ef6b8b74b698ee9 to your computer and use it in GitHub Desktop.
Время первого события текущего дня из журнала событий Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sysLog = new EventLog(); | |
sysLog.Log = "System"; | |
IEnumerable<EventLogEntry> Entries = sysLog.Entries.Cast<EventLogEntry>(); | |
// время первого события текущего дня | |
var startTime = | |
(from l in Entries | |
where l.TimeGenerated.DayOfYear == nowTime.DayOfYear // только события сегодняшнего дня | |
select l.TimeGenerated) | |
.Min(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment