Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.04.01;
Скачать: CL | DM;

Вниз

Как узнать Ip в формате LongInt   Найти похожие ветки 

 
совсем Новенький   (2002-03-21 13:25) [0]

Как узнать Ip в формате LongInt если есть в ***.***.***.***


 
Alx2 ©   (2002-03-21 13:30) [1]


Function IpStrToInt(Const IP: String): Integer;
Function GetNextPart(Var K: Integer): Byte;
Begin
Result := 0;
While (K <= Length(IP)) And (IP[K] <> ".") Do
Begin
Result := 10 * Result + Byte(IP[K]) - Byte("0");
inc(K);
End;
If IP[K] = "." Then inc(K);
End;
Var
Bytes: Array[0..3] Of Byte Absolute Result;
Var K: Integer;
Begin
K := 1;
Bytes[3] := GetNextPart(K);
Bytes[2] := GetNextPart(K);
Bytes[1] := GetNextPart(K);
Bytes[0] := GetNextPart(K);
End;


 
Nebula ©   (2002-03-21 15:54) [2]

uses Winsock;
var
IPAddress: Integer;
InAddr: TInAddr;
IpAddrStr: string;
begin
// туда (Int2Str)
InAddr.S_addr := IPAddress;
IpAddrStr := inet_ntoa(InAddr);
/ и обратно (Str2Int)
IPAddress : =inet_addr(PChar(IpAddrStr));
end




Страницы: 1 вся ветка

Текущий архив: 2002.04.01;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.011 c
1-247
AlexanderS
2002-03-20 23:31
2002.04.01
Как получить значение переменной окружения TEMP?


4-360
sdn
2002-02-01 19:15
2002.04.01
Как создать форму, похожую на ICQ


1-112
Ольга
2002-03-19 16:17
2002.04.01
HELP!!!


3-30
Vasilii
2002-03-06 16:00
2002.04.01
Select к двум различным IB БД


1-158
MaXie
2002-03-22 11:20
2002.04.01
Как совместить ShortString с множеством?