Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
338 views
in Technique[技术] by (71.8m points)

c# - Retrieve Windows Experience Rating

I'm looking to retrieve a machine's windows experience rating in C#. If possible I would also like to retrieve the numbers for each component (Graphics, RAM etc.)

Is this possible?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Every time the user goes through control panel to calculate the Windows Experience Rating, the system creates a new file in %Windows%PerformanceWinSATDataStore

You need to find the most recent file (they are named with the most significant date first, so finding the latest file is trivial).

These files are xml files and are easy to parse with XmlReader or other xml parser.

The section you are interested in is WinSATWinSPR and contains all the scores in a single section. E.g.

<WinSAT>
    <WinSPR>
        <SystemScore>3.7</SystemScore> 
        <MemoryScore>5.9</MemoryScore> 
        <CpuScore>5.2</CpuScore> 
        <CPUSubAggScore>5.1</CPUSubAggScore> 
        <VideoEncodeScore>5.3</VideoEncodeScore> 
        <GraphicsScore>3.9</GraphicsScore> 
        <GamingScore>3.7</GamingScore> 
        <DiskScore>5.2</DiskScore> 
    </WinSPR>
...

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...