Option Explicit
Private Const ANY_SIZE = 16 ' neieuei i?eaaaony IP-aa?ania a nenoaia
Private Type MIB_IPADDRROW
dwAddr(0 To 3) As Byte ' IP address
dwIndex As Long ' interface index
dwMask(0 To 3) As Byte ' subnet mask
dwBCastAddr(0 To 3) As Byte ' broadcast address
dwReasmSize As Long ' rassembly size
unused As Long ' not currently used
End Type
Private Type MIB_IPADDRTABLE
dwNumEntries As Long ' number of entries in the table
Table(1 To ANY_SIZE) As MIB_IPADDRROW ' array of IP address entries
End Type
Private Declare Function GetIpAddrTable Lib "iphlpapi" (pIpAddrTable As MIB_IPADDRTABLE, pdwSize As Long, ByVal bOrder As Long) As Long
Sub Main()
Dim Table As MIB_IPADDRTABLE, i As Long
If GetIpAddrTable(Table, Len(Table), 0) = 0 Then
With Table
For i = 1 To .dwNumEntries
With .Table(i)
Debug.Print "IP: " & .dwAddr(0) & "." & .dwAddr(1) & "." & .dwAddr(2) & "." & .dwAddr(3)
Debug.Print "Interface #: " & .dwIndex
Debug.Print "Subnet mask: " & .dwMask(0) & "." & .dwMask(1) & "." & .dwMask(2) & "." & .dwMask(3)
Debug.Print "Broadcast: " & .dwBCastAddr(0) & "." & .dwBCastAddr(1) & "." & .dwBCastAddr(2) & "." & .dwBCastAddr(3)
Debug.Print
End With
Next
End With
End If
End Sub
Private Sub Form_Load()
Main
End Sub
Чё-то я насчёт IP не понял. В окне браузера написано 10.61.0.90 а на сайтах пишет "Ваш IP 45.110 и тд" по какому IP можно компы в инете соединить?
Sirik писал(а):ладно, так и быть:
- Код: Выделить всё
Option Explicit
Private Const ANY_SIZE = 16 ' neieuei i?eaaaony IP-aa?ania a nenoaia
...
Private Sub Form_Load()
Main
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 59