コード例 #1
0
 private static CpuInfo Load()
 {
     if (RuntimeInformation.IsWindows())
     {
         string content = ProcessHelper.RunAndReadOutput("wmic", "cpu get Name, NumberOfCores, NumberOfLogicalProcessors, CurrentClockSpeed /Format:List");
         return(WmicCpuInfoParser.ParseOutput(content));
     }
     return(null);
 }
コード例 #2
0
 private static CpuInfo Load()
 {
     if (RuntimeInformation.IsWindows())
     {
         string argList = $"{WmicCpuInfoKeyNames.Name}, {WmicCpuInfoKeyNames.NumberOfCores}, {WmicCpuInfoKeyNames.NumberOfLogicalProcessors}, {WmicCpuInfoKeyNames.MaxClockSpeed}";
         string content = ProcessHelper.RunAndReadOutput("wmic", $"cpu get {argList} /Format:List");
         return(WmicCpuInfoParser.ParseOutput(content));
     }
     return(null);
 }