EventInfoProvider Constructor |
Namespace: Xcalibur.WMI.Events
1// Main 2private static void Main() 3{ 4 // Make a connection to the local machine 5 const string computer = "."; 6 var managementScope = new ManagementScope($@"\\{computer}\root\cimv2", new ConnectionOptions 7 { 8 Impersonation = ImpersonationLevel.Impersonate, 9 Authentication = AuthenticationLevel.Connect 10 }); 11 managementScope.Connect(); 12 13 // Load event provider (default, get last 24 hours) 14 var provider = new EventInfoProvider(managementScope); 15 16 // Fetch data 17 provider.Refresh(); 18 19 // Print 20 foreach (var info in provider.Results.Take(3)) 21 { 22 Console.WriteLine($"{info.TimeGenerated}, " + 23 $"{info.RecordNumber}, " + 24 $"{info.SourceName}, " + 25 $"{info.Message}" ); 26 Console.WriteLine(""); 27 Console.WriteLine(""); 28 } 29 30 // Read 31 Console.Read(); 32} 33 34/* Results: 35 * 36 * 3/10/2018 3:28:21 PM, 23848, ESENT, PerfWatson2 (812,G,0) The beta feature EseDiskFlushConsistency is enabled in ESENT due to the beta site mode settings 0x800000. 37 * 38 * 39 * 3/10/2018 3:20:34 PM, 23847, Windows Error Reporting, Fault bucket 125730739576, type 5 40 * Event Name: PerfWatsonVS12Data 41 * Response: Not available 42 * Cab Id: 0 43 * 44 * Problem signature: 45 * P1: PerfWatsonTcdb 46 * P2: 0 47 * P3: 0 48 * P4: 0 49 * P5: 0 50 * P6: 51 * P7: 52 * P8: 53 * P9: 54 * P10: 55 * 56 * Attached files: 57 * \\?\C:\Users\josha\AppData\Local\Temp\VSTelem.Out\201803102020_D15.6_15.6.27428.2002_c97ca5f5908e4902873d0846f200eb7518376.tcdb 58 * \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER72C6.tmp.WERInternalMetadata.xml 59 * \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER72DA.tmp.csv 60 * \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER72FA.tmp.txt 61 * 62 * These files may be available here: 63 * C:\ProgramData\Microsoft\Windows\WER\ReportArchive\NonCritical_PerfWatsonTcdb_688f135dd185f2a8133a474a2518efc6ce6cc4a_00000000_6ff575a5 64 * 65 * Analysis symbol: 66 * Rechecking for solution: 0 67 * Report Id: e37444ca-ce1d-4929-9eb8-903409c20333 68 * Report Status: 268435456 69 * Hashed bucket: fb30d2b9a7acf0305d4da51668259751 70 * 71 * 72 * 3/10/2018 3:20:27 PM, 23846, ESENT, PerfWatson2 (22708,G,0) The beta feature EseDiskFlushConsistency is enabled in ESENT due to the beta site mode settings 0x800000. 73 * 74 * 75 */