收藏 (0) +1 (0) +1 (0) +1
收藏成功查看收藏>>

正在阅读:VB学习:MX记录获取组件VB学习:MX记录获取组件

2004-03-10 09:52 出处:CSDN 作者:glling 责任编辑:linjixiong

  ' Step over the RR Type, RR Class, TTL (3 integers - 6 bytes)
  iNdx = iNdx + 1 + 6

  ' Read the MX data length specifier
  ' (not needed, hence why it's commented out)
  MemCopy iMXLen, dnsReply(iNdx), 2
  iMXLen = ntohs(iMXLen)
 
  ' Step over the MX data length specifier (1 integer - 2 bytes)
  iNdx = iNdx + 2

  MemCopy iPref, dnsReply(iNdx), 2
  iPref = ntohs(iPref)
  ' Step over the MX preference value (1 integer - 2 bytes)
  iNdx = iNdx + 2

  ' Have to step through the byte-stream, looking for 0xc0 or 192 (compression char)
  Dim iNdx2 As Integer
  iNdx2 = iNdx
  ParseName dnsReply(), iNdx2, sName
  If (iBestPref = -1 Or iPref < iBestPref) Then
  iBestPref = iPref
  sBestMX = sName
  End If
  iNdx = iNdx + iMXLen + 1
  ' Step over 3 useless bytes
  'iNdx = iNdx + 3
  Else
  GetMXName = sBestMX
  Exit Function
  End If
  iAnCount = iAnCount - 1
  Wend

  GetMXName = sBestMX
  End Function

  Public Function GetDNSinfo() As String
  Dim error As Long
  Dim FixedInfoSize As Long
  Dim strDNS As String
  Dim FixedInfo As FIXED_INFO



察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:

键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品
手机访问回到顶部