Вниз
Скачать: CL | DM;

Как узнать в Вин IP адрес?   Найти похожие ветки 

← →
трям   (2003-03-26 01:12) [0]

желательно на API:)


← →
трям   (2003-03-26 01:19) [1]

и без winsocka !:)


← →
Alex Konshin ©   (2003-03-26 01:40) [2]

и без tcp/ip!:)


← →
Landgraph   (2003-03-26 14:18) [3]

про udp забыли =)


← →
Smithson ©   (2003-03-26 15:25) [4]


function GetIPaddress: String;
const bufsize = 255;
var WSA: WSAData;
buf: pointer;
RemoteHost : PHostEnt; (* No, don"t free it! *)
D: record
case Byte of
0: ( L: LongInt );
1: ( B: Array[0..3] of byte );
end;
Begin
WSAStartUp($101,WSA);
buf:=NIL;
try
getmem(buf,bufsize);
winsock.gethostname(buf,bufsize); (* this one maybe without domain *)
RemoteHost:=Winsock.GetHostByName(buf);
if RemoteHost=NIL then
Result := "No TCP/IP" (* 127.0.0.1 *)
else begin
D.L := longint(pointer(RemoteHost^.h_addr_list^)^);
Result := IntToStr(D.B[0])+"."+IntToStr(D.B[1])+"."+IntToStr(D.B[2])+"."+IntToStr(D.B[3]);
end;
finally
if buf <> NIL then freemem(buf,bufsize);
end;
WSACleanup();
End;



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

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.01 c
11-83431
MyVeryShortLogin
2002-08-16 13:47
2003.05.26
Не обрабатывается событие OnKeyDown


1-83589
Михайлов Антон
2003-05-14 14:26
2003.05.26
md5


1-83579
tv
2003-05-13 13:50
2003.05.26
OleVariant


4-83812
Songoku
2003-03-29 12:26
2003.05.26
Как поменять Color в RadioButton через API????


1-83461
vidiv
2003-05-05 09:42
2003.05.26
Как получить ContactList и History у ICQ 2002-2003?




   Наверх