ProcessorInfoProvider Constructor |
Namespace: Xcalibur.WMI.Hardware.Processor
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 // Processor Info Provider 14 var provider = new ProcessorInfoProvider(managementScope); 15 16 // Fetch data 17 provider.Refresh(); 18 19 // Print 20 foreach (var info in provider.Results) 21 { 22 Console.WriteLine($"Name: \t\t\t{info.Name}"); 23 Console.WriteLine($"Manufacturer: \t\t{info.Manufacturer}"); 24 Console.WriteLine($"Architecture: \t\tx{info.Architecture}"); 25 Console.WriteLine($"ProcessorId: \t\t{info.ProcessorId}"); 26 Console.WriteLine($"Revision: \t\t{info.Revision}"); 27 Console.WriteLine($"Speed: \t\t\t{info.Speed} MHz"); 28 Console.WriteLine($"Cores: \t\t\t{info.Cores}"); 29 Console.WriteLine($"Count: \t\t\t{info.Count}"); 30 Console.WriteLine($"L2CacheSize: \t\t{info.L2CacheSize} KB"); 31 Console.WriteLine($"L3CacheSize: \t\t{info.L3CacheSize} KB"); 32 Console.WriteLine($"IsHyperThreaded: \t{info.IsHyperThreaded}"); 33 Console.WriteLine($"SocketDesignation: \t{info.SocketDesignation}"); 34 Console.WriteLine(""); 35 } 36 37 // Read 38 Console.Read(); 39} 40 41/* Results (Skylake i7-6700K): 42 * 43 * Name: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz 44 * Manufacturer: GenuineIntel 45 * Architecture: x64 46 * ProcessorId: BFEBFBFF000506E3 47 * Revision: 24067 48 * Speed: 4008 MHz 49 * Cores: 4 50 * Count: 1 51 * L2CacheSize: 1024 KB 52 * L3CacheSize: 8192 KB 53 * IsHyperThreaded: True 54 * SocketDesignation: LGA1151 55 * 56 */