3

Possible Duplicate:
Retrieve Windows Experience Rating

Using .NET, is there a way to programmatically query the present value of the Windows Experience Index?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Ian
  • 5,625
  • 11
  • 57
  • 93

2 Answers2

3

Hopefully the StackOverflow engine won't transform this into an autocomment.

See this Stack Overflow answer:

Community
  • 1
  • 1
Matthew Abbott
  • 60,571
  • 9
  • 104
  • 129
2

Another option is use the WinSAT Interfaces for this task, check the IProvideWinSATResultsInfo interface for more info and the WMI Class Win32_WinSAT.

Check this sample code

using System;
using System.Collections.Generic;
using System.Management;
using System.Text;

namespace ConsoleApplication13
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                ManagementObjectSearcher searcher =
                    new ManagementObjectSearcher("root\\CIMV2",
                    "SELECT * FROM Win32_WinSAT");

                foreach (ManagementObject queryObj in searcher.Get())
                {
                    Console.WriteLine("CPUScore: {0}", queryObj["CPUScore"]);
                    Console.WriteLine("D3DScore: {0}", queryObj["D3DScore"]);
                    Console.WriteLine("DiskScore: {0}", queryObj["DiskScore"]);
                    Console.WriteLine("GraphicsScore: {0}", queryObj["GraphicsScore"]);
                    Console.WriteLine("MemoryScore: {0}", queryObj["MemoryScore"]);
                    Console.WriteLine("TimeTaken: {0}", queryObj["TimeTaken"]);
                    Console.WriteLine("WinSATAssessmentState: {0}", queryObj["WinSATAssessmentState"]);
                    Console.WriteLine("WinSPRLevel: {0}", queryObj["WinSPRLevel"]);
                }
            }
            catch (ManagementException e)
            {
                Console.WriteLine(e.Message);
            }
            Console.Read();
        }
    }
}
RRUZ
  • 134,889
  • 20
  • 356
  • 483
  • In 64bit environment, if the sample is compiled with /platform:x86, results are always zero and WinSATAssessmentState is 3. – sjlewis Mar 20 '12 at 14:08