IP获取代码.doc

  1. 1、本文档共3页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
IP获取代码

IP??è?′ú??.txtμ¥éíoüí′?à£?μ¥éí??á??üí′?à£??°??ìì?ò?′??ò?í·???í£?????μ??ü??????D?μ?ê2?′?D2Dèì£? ê??Dè?£??ò?í′ò????èyì?íè£?ê?1?1·£??ò?í′ò???ü??ì?íè£? Option Explicit ===================ò????¨ò?ó?óú??μ?±??úIP================== Private Const WSADescription_Len = 256 Private Const WSASYS_Status_Len = 128 Private Type WSA_DATA wVersion As Integer wHighVersion As Integer strDescription(WSADescription_Len + 1) As Byte strSystemStatus(WSASYS_Status_Len + 1) As Byte iMaxSockets As Integer iMaxUdpDg As Integer lpVendorInfo As Long End Type Private Type HOSTENT hname As Long hAliases As Long hAddrType As Integer hLength As Integer hAddrList As Long End Type Private Declare Function WSAStartup Lib ws2_32.dll (ByVal _ wVersionRequired, lpWSAData As WSA_DATA) As Long Private Declare Function gethostbyname Lib ws2_32.dll (ByVal hostname$) As Long Private Declare Sub CopyMemory Lib kernel32 Alias RtlMoveMemory (Destination As Any, Source As Any, ByVal length As Long) Private Declare Function WSACleanup Lib ws2_32.dll () As Long ===================ò?é??¨ò?ó?óú??μ?±??úIP================== =====================ò????¨ò?ó?óú??μ?MAC==================== Private Declare Function SendARP Lib iphlpapi (ByVal dest As Long, ByVal host As Long, ByRef Mac As Any, ByRef length As Long) As Long Private Declare Function inet_addr Lib ws2_32.dll (ByVal cp As String) As Long =====================ò?é??¨ò?ó?óú??μ?MAC==================== ??μ????¨IPμ??·μ?MACμ??·£?ó?μ?è???±?á?hostIpStr?a±??úIPμ??· ê?è?£oIP?a±?í??úμ?IPμ??·×?·?′?£?oˉêy·μ??MACμ??·£?è?3?′í·μ????×?·?′? Function GetMac(IP As String) As String Dim ldest As Long, lhost As Long, Mac(5) As Byte, length As Long Dim i As Long, lR As Long, hostIpStr As String hostIpStr = GetMyIp GetMac = è?μ?2?μ?MAC£? If hostIpStr Then ldest = inet_addr(IP) //??μ?μ?μ?IP×a???aIP?ú??D?ê? lhost = inet_addr(hostIpStr) //??±??úIP×a???aIP?ú??D?ê? length = 6 lR = SendARP(ldest, lhost, Mac(0), length) If length 0 Then For i = 0 To length - 1 GetMac = GetMac Right(00 H

文档评论(0)

qwd513620855 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档