neprden » 21.09.2006 (Чт) 19:51
да блин я ДЛЛ ку то на vb6 писал - может скомпил как то не так ? Зачем переместили ?
вот кстати дллка
Private rwREmoteIP_ As String
Private r_echo_ As ICMP_ECHO_REPLY
Private rwData_ As String
Private rwTIMEOUT_ As Long
Private rwOPTIONS_ As IP_OPTION_INFORMATION
Public Event IcmpError(ErrorMessage As String)
Public Type ICMP_OPTIONS_
Ttl As Byte
tos As Byte
Flags As Byte
OptionsSize As Byte
OptionsData As Long
End Type
Public Type ICMP_ECHO_REPLY_
RemoteAddressStr As String
RemoteAddress As Long
status As Long
RoundTripTime As Long
DataSize As Integer
Reserved As Integer
DataPointer As Long
OPTIONS As ICMP_OPTIONS_
Data As String
strStatus As String
End Type
Public Event icmpRecive(status As Long, eRTT As Long, eTTL As Byte, eRAddress As String)
Public Property Get DataForSend() As String
DataForSend = rwData_
End Property
Public Property Let DataForSend(newstr As String)
rwData_ = newstr
End Property
Public Property Get RemoteIP() As String
RemoteIP = rwREmoteIP_
End Property
Public Property Let RemoteIP(newstr As String)
rwREmoteIP_ = newstr
End Property
Public Property Get TIMEOUT() As Long
TIMEOUT = rwTIMEOUT_
End Property
Public Property Let TIMEOUT(newstr As Long)
rwTIMEOUT_ = newstr
End Property
Public Property Get OPTIONS_TTL() As Long
OPTIONS_TTL = rwOPTIONS_.Ttl
End Property
Public Property Let OPTIONS_TTL(newstr As Long)
rwOPTIONS_.Ttl = newstr
End Property
Public Property Get OPTIONS_TOS() As Long
OPTIONS_TOS = rwOPTIONS_.tos
End Property
Public Property Let OPTIONS_TOS(newstr As Long)
rwOPTIONS_.tos = newstr
End Property
Public Property Get OPTIONS_FLAG() As Long
OPTIONS_FLAG = rwOPTIONS_.Flags
End Property
Public Property Let OPTIONS_FLAG(newstr As Long)
rwOPTIONS_.Flags = newstr
End Property
Public Property Get OPTIONS_LEN_OPT() As Long
OPTIONS_LEN_OPT = rwOPTIONS_.OptionsSize
End Property
Public Property Let OPTIONS_LEN_OPT(newstr As Long)
rwOPTIONS_.OptionsSize = newstr
End Property
Public Property Get OPTIONS_OPT() As String
OPTIONS_OPT = rwOPTIONS_.OptionsData
End Property
Public Property Let OPTIONS_OPT(newstr As String)
rwOPTIONS_.OptionsData = newstr
End Property
Public Property Get RTT() As String
RTT = r_echo_.RoundTripTime
End Property
Public Property Get Echo() As ICMP_ECHO_REPLY_
If r_echo_.Address <> 0 Then
Echo.RemoteAddressStr = GetIPStrFromLOng(r_echo_.Address)
Echo.RemoteAddress = r_echo_.Address
End If
If r_echo_.DataSize > 0 Then Echo.Data = Left(r_echo_.Data, r_echo_.DataSize)
Echo.DataPointer = r_echo_.DataPointer
Echo.DataSize = r_echo_.DataSize
Echo.OPTIONS.Flags = r_echo_.OPTIONS.Flags
Echo.OPTIONS.OptionsData = r_echo_.OPTIONS.OptionsData
Echo.OPTIONS.OptionsSize = r_echo_.OPTIONS.OptionsSize
Echo.OPTIONS.tos = r_echo_.OPTIONS.tos
Echo.OPTIONS.Ttl = r_echo_.OPTIONS.Ttl
Echo.Reserved = r_echo_.Reserved
Echo.RoundTripTime = r_echo_.RoundTripTime
Echo.status = r_echo_.status
Echo.strStatus = GetStatusCode(r_echo_.status)
End Property
Public Function DoPing(Optional mIpAddress As String) As Long
Dim nultmp As ICMP_ECHO_REPLY
Dim errm As String
Dim ret As Long
If mIpAddress <> "" Then rwREmoteIP_ = mIpAddress
ret = Ping(rwREmoteIP_, r_echo_, rwOPTIONS_, errm, rwData_, rwTIMEOUT_)
If ret = 0 Then
RaiseEvent IcmpError(errm)
r_echo_ = nultmp
Exit Function
End If
RaiseEvent icmpRecive(r_echo_.status, r_echo_.RoundTripTime, r_echo_.OPTIONS.Ttl, GetIPStrFromLOng(r_echo_.Address))
DoPing = r_echo_.status
End Function
Public Function doConvertIpToString(ByVal iPaddress As Long) As String
doConvertIpToString = GetIPStrFromLOng(iPaddress)
End Function
Private Sub Class_Initialize()
rwTIMEOUT_ = PING_TIMEOUT
r_echo_.RoundTripTime = 0
End Sub