Private Declare Function GetIpAddrTable Lib "iphlpapi" (pIpAddrTable As MIB_IPADDRTABLE, pdwSize As Long, ByVal Border As Long) As Long
Private Const ANY_SIZE = 16
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 Function GetIP() As String
Dim Table As MIB_IPADDRTABLE
If GetIpAddrTable(Table, Len(Table), 0) = 0 Then GetIP = Table.Table(1).dwAddr(0) & "." & Table.Table(1).dwAddr(1) & "." & Table.Table(1).dwAddr(2) & "." & Table.Table(1).dwAddr(3)
End Function
<?
echo $REMOTE_ADDR;
?>
IP-адрес (aй-пи адрес, сокращение от англ. Internet Protocol Address) — уникальный идентификатор (адрес) устройства (обычно компьютера), подключённого к локальной сети или интернету.
Сейчас этот форум просматривают: Yandex-бот и гости: 67