Hello,
I am wondering if there is a way to get the system preformance rating that windows vista generates through VB.NET. Please reply if you know a way.
Thanks,
Nabeel Allana
Hello,
I am wondering if there is a way to get the system preformance rating that windows vista generates through VB.NET. Please reply if you know a way.
Thanks,
Nabeel Allana
Getting System Rating
Ronny Lewandowski
I don't have vista to test this our and you mostly likely have to look up the correct syntax for the ManagementObject class, but try something like this:
Imports System.Management
Module Module1
Sub Main()
Try
Dim mo As ManagementObject
mo = New ManagementObject("Select * From Win32_WinSAT")
Console.WriteLine("Processor: " + mo("CPUScore").ToString())
Console.WriteLine("Memory: " + mo("MemoryScore").ToString())
Console.WriteLine("Primary Hard Disk: " + mo("DiskScore").ToString())
Console.WriteLine("Graphics: " + mo("GraphicsScore").ToString())
Console.WriteLine("Gaming graphics: " + mo("D3DScore").ToString())
Console.WriteLine("Windows System Performance Rating: " + mo("WinCRSLevel").ToString())
Console.ReadLine()
Catch e As ManagementException
Console.WriteLine("Management exception encountered: " + e.ToString())
Console.ReadLine()
Catch e As Exception
Console.WriteLine("Exception encountered: " + e.ToString())
Console.ReadLine()
End Try
End Sub
End Module
Reference:
http://msdn2.microsoft.com/en-gb/library/aa969204.aspx
CirdanCelebrindal
Thanks, I just needed to know what WMI Class to use.
This is what I used:
Public Function GetScores() As String Dim objs As Object Dim obj As Object Dim WMI As Object Dim manufacturer As StringWMI = GetObject(
"WinMgmts:")objs = WMI.InstancesOf(
"Win32_WinSAT") For Each obj In objsRating = Rating & "Processor: " & obj.CPUScore & vbCrlf.ToString() & "Memory: " & obj.MemoryScore (ect.ect.ect...)
Nextgetcpuinfomore = Rating
End Function
PS. I am the KlmSoftware.net guy above... I had forgot to change my name properly.
Thanks again :),
Nabeel Allana