眾所周知在Windows 7 中我們可以通過右鍵“我的電腦”->“屬性”查看系統效能綜合得分。這個分數包含了Processor、Memory、Graphics、Gaming Graphics、Hard drive 五方面效能測評分數。CodePlex 中有一個叫做“WEI Share” 的項目,涉及WPF、WCF、Silverlight、Azure 多種.NET 技術。通過該軟體不但可以獲得電腦效能分數,還能夠將本機資料分享到社區。例如,WEI Share 雲端伺服器、Facebook。
軟體使用
應用程式既可以到WEI Share 網站直接下載使用,也可以下載原始碼編譯產生,大多數Dev可能都喜歡後者。運行程式後因個人機器不同可能會提示需要重新測評電腦效能。
測評過程軟體會調用C:\Windows\System32\WinSAT.ext 對系統各項效能指標進行測試。
漫長的等待後,最終通過GetLatestWinSATFileInfo 方法得到C:\Windows\Performance\WinSAT\DataStore 目錄中剛剛完成的最新測評資料。
public static System.IO.FileInfo GetLatestWinSATFileInfo(){ // Check if the computer has a \WinSAT dir. if (System.IO.Directory.Exists(Helpers.Globals.WinSatDataStoreFolderPath)) { // Because the program makes a new XML file on every update of the score, // we need to calculate the most recent, just incase the owner has upgraded. System.IO.DirectoryInfo xmlFolder = new System.IO.DirectoryInfo(Helpers.Globals.WinSatDataStoreFolderPath); DateTime lastAccessTime = DateTime.MinValue; return xmlFolder.GetFiles("*.WinSAT.xml").ToList().OrderByDescending(i => i.Name).FirstOrDefault(); } return null;}
分享WEI 資料
在分數列表右側有兩個按鍵“add to WEI Share”和“post to facebook”,提供了將測評資料分享到“WEI Share” 或“Facebook”的功能。程式通過WCF 將資料上傳到由Silverlight 開發的WEI Share 雲端伺服器(感興趣的朋友可以下載源碼自行研究)。在該網站我們可以參考其他分值測評資料的配置資訊。
也可以將資料發送到個人Facebook 分享給好友參考。
相關參考
WEI Share
http://weishare.cloudapp.net/
http://weishare.codeplex.com/
Channel9 Video
http://channel9.msdn.com/posts/LarryLarsen/WEI-Share-Share-you-Windows-7-Experience-Index/