主题:[讨论]如何获得系统信息
当要获得计算机系统信息的时候,使用以下语句
Dim search As New ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem")
Dim info As ManagementObject
Try
For Each info In search.Get()
rtbInfo_Check.Text += "maker:" & info("model").ToString()
...
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
错误:无法识别类
如果是
Dim search As New ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem")
Dim info As ManagementObject
Try
search.Get()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
则没有错误
高手看看是怎么会事
Dim search As New ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem")
Dim info As ManagementObject
Try
For Each info In search.Get()
rtbInfo_Check.Text += "maker:" & info("model").ToString()
...
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
错误:无法识别类
如果是
Dim search As New ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem")
Dim info As ManagementObject
Try
search.Get()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
则没有错误
高手看看是怎么会事