如何用VB获得机器的MAC地址
5个回答
2015-12-09
展开全部
Private Sub Form_Load()
GetMyIP
End Sub
Sub GetMyIP() '获取IP地址、网卡类型、网卡地址
Dim strComputer As String
Dim objWMI As Object
Dim colIP As Object
Dim IP As Object
Dim I As Integer
strComputer = "."
Set objWMI = GetObject("winmgmts://" & strComputer & "/root/cimv2")
Set colIP = objWMI.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IP In colIP
If Not IsNull(IP.IPAddress) Then
For I = LBound(IP.IPAddress) To UBound(IP.IPAddress)
MsgBox "IP 地址:" & IP.IPAddress(I) & Chr(10) & _
"网卡类型:" & IP.Description(I) & Chr(10) & _
"网卡地址:" & IP.Macaddress(I)
Next
End If
Next
End Sub
杭州一知智能科技有限公司
2022-03-17 广告
2022-03-17 广告
电话机器人主要就是用来模拟人工通话的一组程序,一般由,CRM系统,语义识别,转换文字,话术体系,这是软的部分,再加上底层软交换和通信模块一起,合并起来就是一套完整的电话机器人系统。电话机器人可以代替真人进行电话工作的,像是电话营销、售后回访...
点击进入详情页
本回答由杭州一知智能科技有限公司提供
展开全部
可以用ipconfig来获取
首先:
cmd /c ipconfig /all >>> "c:\mac.txt"
然后识别mac.txt内的文本,找到mac地址那一行,直接取出来就行了
首先:
cmd /c ipconfig /all >>> "c:\mac.txt"
然后识别mac.txt内的文本,找到mac地址那一行,直接取出来就行了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Load()
GetMyIP
End Sub
Sub GetMyIP() '获取<a href="https://www.baidu.com/s?wd=IP%E5%9C%B0%E5%9D%80&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9uAD3PWnzPyD1PH6kmyf40ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EPjbsrHcLPH0znHRYnWcLPHTz" target="_blank" class="baidu-highlight">IP地址</a>、网卡类型、网卡地址
Dim strComputer As String
Dim objWMI As Object
Dim colIP As Object
Dim IP As Object
Dim I As Integer
strComputer = "."
Set objWMI = GetObject("winmgmts://" & strComputer & "/root/cimv2")
Set colIP = objWMI.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IP In colIP
If Not IsNull(IP.IPAddress) Then
For I = LBound(IP.IPAddress) To UBound(IP.IPAddress)
MsgBox "IP 地址:" & IP.IPAddress(I) & Chr(10) & _
"网卡类型:" & IP.Description(I) & Chr(10) & _
"网卡地址:" & IP.Macaddress(I)
Next
End If
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Load()
GetMyIP
End Sub
Sub GetMyIP() '获取IP地址、网卡类型、网卡地址
Dim strComputer As String
Dim objWMI As Object
Dim colIP As Object
Dim IP As Object
Dim I As Integer
strComputer = "."
Set objWMI = GetObject("winmgmts://" & strComputer & "/root/cimv2")
Set colIP = objWMI.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IP In colIP
If Not IsNull(IP.IPAddress) Then
For I = LBound(IP.IPAddress) To UBound(IP.IPAddress)
MsgBox "IP 地址:" & IP.IPAddress(I) & Chr(10) & _
"网卡类型:" & IP.Description(I) & Chr(10) & _
"网卡地址:" & IP.Macaddress(I)
Next
End If
Next
End Sub
GetMyIP
End Sub
Sub GetMyIP() '获取IP地址、网卡类型、网卡地址
Dim strComputer As String
Dim objWMI As Object
Dim colIP As Object
Dim IP As Object
Dim I As Integer
strComputer = "."
Set objWMI = GetObject("winmgmts://" & strComputer & "/root/cimv2")
Set colIP = objWMI.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IP In colIP
If Not IsNull(IP.IPAddress) Then
For I = LBound(IP.IPAddress) To UBound(IP.IPAddress)
MsgBox "IP 地址:" & IP.IPAddress(I) & Chr(10) & _
"网卡类型:" & IP.Description(I) & Chr(10) & _
"网卡地址:" & IP.Macaddress(I)
Next
End If
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
第一步,创建Form
第二部,敲入如下代码
Private Sub Form_Load()
GetMyMAC
End Sub
Sub GetMyMAC() '网卡地址
Dim strComputer As String
Dim objWMI As Object
Dim colIP As Object
Dim IP As Object
Dim I As Integer
strComputer = "."
Set objWMI = GetObject("winmgmts://" & strComputer & "/root/cimv2")
Set colIP = objWMI.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IP In colIP
If Not IsNull(IP.IPAddress) Then
For I = LBound(IP.IPAddress) To UBound(IP.IPAddress)
MsgBox "MAC地址:" & IP.Macaddress(I)
Next
End If
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询