Here is an example:

private static ManagementObjectSearcher Processor = new ManagementObjectSearcher(@"root\CIMV2", "SELECT * FROM Win32_Processor"); var ProcessorName = Processor.Get().Cast<ManagementObject>().Select(gob => (string)gob["Name"] + gob["Manufacturer"]).ToList(); 

[Name - Процессор + Manufacturer - Производитель]

I write in StringBuilder sb = new StringBuilder();

 sb.AppendFormat("Процессор: ", ProcessorName.Select(s => $"{s}")); 

The output is an error:

Processor: System.Linq.Enumerable + WhereSelectListIterator`2 [System.String, System.String]

    1 answer 1

    No error, you are trying to print, as I understand the object that returns Select (IEnumerable in your case)

    Try turning the collection into a string like this:

    string.Join(", ", ProcessorName)

    • Thanks, helped) - GooliveR
    • 2
      .Select(s => $"{s}") redundant. - Athari
    • @Squidward, in what sense is redundant? - GooliveR
    • @GooliveR, just try string.Join(", ", ProcessorName) The result will be the same. I will correct in the answer too - Chloroform