Ok i can't figure this out when i run my app it halts at,
The error is, System.NullReferenceException{"Object reference not set to an instance of an object."},VB Code:
lblCPU.Text += "L2CacheSpeed: " & info("L2CacheSpeed").ToString() & CRLF
Here is all my code for the app,
VB Code:
'Set were the form is showen on the desktop Me.Location = New Point(1010, 30) ' This is to show how to use the SelectQuery object in the place of a SELECT ' statement. Dim query As New SelectQuery("Win32_processor") 'ManagementObjectSearcher retrieves a collection of WMI objects based on ' the query. Dim search As New ManagementObjectSearcher(query) ' Display each entry for Win32_processor Dim info As ManagementObject For Each info In search.Get() lblCPU.Text = "CPU Name: " & info("Name").ToString() & CRLF lblCPU.Text += "Caption: " & info("Caption").ToString() & CRLF lblCPU.Text += "CurrentClockedSpeed: " & info("CurrentClockSpeed").ToString() & CRLF lblCPU.Text += "MaxClockSpeed: " & info("MaxClockSpeed").ToString() & CRLF lblCPU.Text += "ExtClock: " & info("ExtClock").ToString() & CRLF lblCPU.Text += "CurrentVoltage: " & info("CurrentVoltage").ToString() & CRLF lblCPU.Text += "L2CacheSize: " & info("L2CacheSize").ToString() & CRLF lblCPU.Text += "L2CacheSpeed: " & info("L2CacheSpeed").ToString() & CRLF lblCPU.Text += "Status: " & info("Status").ToString() & CRLF Next
Im Using vb.net 2005 Express.





Reply With Quote