' 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 |
正在阅读:VB学习:MX记录获取组件VB学习:MX记录获取组件
2004-03-10 09:52
出处:CSDN
责任编辑:linjixiong
键盘也能翻页,试试“← →”键