引用Microsoft WMI Scripting V1.1 Library
然后用下面的代码,将在Text1中显示出所的的信息
Private Sub GetProcessorID()
Dim a As SWbemServices
Dim b As SWbemObjectSet
Dim c As SWbemObject
Dim d As SWbemPropertySet
Dim e As SWbemProperty
Set a = GetObject("winmgmts:")
Set b = a.InstancesOf("Win32_Processor")
For Each c In b
With c
If .Properties_.Count > 0 Then
Set d = .Properties_
For Each e In d
Text1 = Text1 & e.Name & ": " & e.Value & vbCrLf
Next
End If
End With
Next
End SubPrivate Sub Form_Load()
GetProcessorID
End Sub
然后用下面的代码,将在Text1中显示出所的的信息
Private Sub GetProcessorID()
Dim a As SWbemServices
Dim b As SWbemObjectSet
Dim c As SWbemObject
Dim d As SWbemPropertySet
Dim e As SWbemProperty
Set a = GetObject("winmgmts:")
Set b = a.InstancesOf("Win32_Processor")
For Each c In b
With c
If .Properties_.Count > 0 Then
Set d = .Properties_
For Each e In d
Text1 = Text1 & e.Name & ": " & e.Value & vbCrLf
Next
End If
End With
Next
End SubPrivate Sub Form_Load()
GetProcessorID
End Sub
解决方案 »
- 求SELECT * FROM where between and在搜索时间段中的写法
- 问题!!如何获得后台窗口的屏幕截图?
- VB怎么调用C++编写的动态联接库?
- 使用过fpspread的兄弟请进来
- 如何取得一个文件夹中的所有子文件夹的名称
- 请问VB如何可以实现全屏播放一个avi文件,然后打开一个HTML文件呢?请指教,谢谢!
- VB中怎么使用WMI服务(135端口的那个)?
- 在ActiveReport1.0+sp4中,怎样做横向报表?
- 请教一个常用关于分类汇总sql的写法及用activate report输入的问题
- 数据库中利用数据访问对象进行查找的问题!!!!!?????
- VB如何读取主板号或CPU号?
- 怎样才能使VB通过身份验正发邮件?
如何在VB里实现直接到硬件的操作
然后用下面的代码,将在Text1中显示出所的的信息
Private Sub GetProcessorID()
Dim a As SWbemServices
Dim b As SWbemObjectSet
Dim c As SWbemObject
Dim d As SWbemPropertySet
Dim e As SWbemProperty
Set a = GetObject("winmgmts:")
Set b = a.InstancesOf("Win32_Processor")
For Each c In b
With c
If .Properties_.Count > 0 Then
Set d = .Properties_
For Each e In d
Text1 = Text1 & e.Name & ": " & e.Value & vbCrLf
Next
End If
End With
Next
End SubPrivate Sub Form_Load()
GetProcessorID
End Sub