WMI 如何得到网卡型号
WMI 如何得到网卡型号
用VB 实现
我现在用
'EtherNet
Dim ethernet As Object '网卡对象
Dim ethernett As Object '网卡子对象
Dim ethernetName As String
Set ethernet = GetObject("winmgmts:{impersonationLevel=impersonate}") _
.InstancesOf("Win32_NetworkAdapter")
For Each ethernett In ethernet
ethernetName = ethernett.Name
Exit For
Next
txt_lan.Text = ethernetName
得到的:txt_lan.Text的值是 RAS同步适配器
而我的网卡是intel的
RAS同步适配器 是什么
[解决办法]
'网卡MAC地址,型号
'引用MICROSOFT WMI脚本库
Private Sub Command1_Click()
Dim NCObj As SWbemObjectSet
Dim NCSubObj As SWbemObject
Dim NCSubObjAttr As SWbemProperty
Dim NCMsg$
Set NCObj = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_NetworkAdapter")
For Each NCSubObj In NCObj
NCMsg = NCMsg & NCSubObj.Name & " [" & NCSubObj.MACAddress & "]" & vbCrLf
Next
MsgBox NCMsg, 64, "网卡信息"
End Sub