Exitfunction:
Set objShell = Nothing
Set objFolder = Nothing
Set objFolderItem = Nothing
Set objShellFolderItem = Nothing
Set objFolderItemVerb = Nothing
End Function
如何通过VB编程得到同一个局域网内的其它电脑的MAC地址??【包含vb.netarp的词条】Public Declare Function inet_addr Lib "wsock32.dll" (ByVal s As String) As Long
Public Declare Function SendARP Lib "iphlpapi.dll" (ByVal DestIP As Long, ByVal SrcIP As Long, pMacAddr As Long, PhyAddrLen As Long) As Long
Public Declare Sub CopyMemory1 Lib "kernel32" Alias "RtlMoveMemory" (dst As Any, src As Any, ByVal bcount As Long)
Public Function GetRemoteMACAddress(ByVal sRemoteIP As String)
Dim dwRemoteIPAs Long
Dim pMacAddrAs Long
Dim bpMacAddr()As Byte
Dim PhyAddrLenAs Long
Dim cntAs Long
Dim tmpAs String
'convertthestringIPinto
'anunsignedlongvaluecontaining
'asuitablebinaryrepresentation
'oftheInternetaddressgiven
dwRemoteIP = inet_addr(sRemoteIP)
If dwRemoteIP0 Then
'setPhyAddrLento6
PhyAddrLen = 6
'retrievetheremoteMACaddress
On Error Resume Next
If SendARP(dwRemoteIP, 0, pMacAddr, PhyAddrLen) = 0 Then
'GetRemoteMACAddress = pMacAddr
'Exit Function
If pMacAddr0 And PhyAddrLen0 Then
'returnedvalueisalongpointer
'tothemacaddress,socopydata
'toabytearray
ReDim bpMacAddr(0 To PhyAddrLen - 1)
CopyMemory1 bpMacAddr(0), pMacAddr, ByVal PhyAddrLen
'loopthrougharraytobuildstring
For cnt = 0 To PhyAddrLen - 1
If bpMacAddr(cnt) = 0 Then
tmp = tmp"00-"
Else
If Len(Hex$(bpMacAddr(cnt))) = 1 Then
tmp = tmp"0"Hex$(bpMacAddr(cnt))"-"
Else
tmp = tmpHex$(bpMacAddr(cnt))"-"
End If
End If
Next
'removethetrailingdash
'addedaboveandreturnTrue
If Len(tmp)0 Then
'sRemoteMacAddress = Left$(tmp, Len(tmp) - 1)
GetRemoteMACAddress = Left$(tmp, Len(tmp) - 1)
End If
Exit Function
Else
GetRemoteMACAddress = False
End If
Else
GetRemoteMACAddress = False
End If'SendARP
Else
GetRemoteMACAddress = False
End If'dwRemoteIP
End Function
关于vb.netarp和的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。
推荐阅读
- b站私人直播间苹果,b站直播ios送礼
- 几个闲置电脑硬盘怎么分区,多个闲置硬盘怎么利用
- 附件怎么放在pdf里,附件怎么转换成pdf
- 快手如何申请直播推荐评论,快手如何申请直播推荐评论权限
- php导出关联表数据 php如何导出数据库
- 电视控制器怎么冲电,电视控制器坏了怎么办
- 金山wps转word软件,金山wps转word格式
- 抖音卖东西如何开直播,抖音卖东西如何开直播赚佣金
- java代码写回文数 回文数java程序编写