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

Вниз

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

 
moor38   (2004-03-12 18:23) [0]

Как в сети по IP адресу узнать имя машины?


 
ki11er   (2004-03-12 18:35) [1]

gethostbyaddr


 
moor38   (2004-03-12 18:39) [2]

нет не моей тачки, а удаленно другой находящейся в сети


 
ki11er   (2004-03-12 18:43) [3]

Ну так и дай на вход адрес той машины, для которой хочешь узнать


 
moor38   (2004-03-12 18:46) [4]

не понял


 
ki11er   (2004-03-12 18:48) [5]

struct HOSTENT FAR * gethostbyaddr(
 const char FAR *addr,
 int len,
 int type
);

addr
[in] Pointer to an address in network byte order.
len
[in] Length of the address.
type
[in] Type of the address, such as the AF_INET address family type (defined as TCP, UDP, and other associated Internet protocols). Address family types and their corresponding values are defined in the Winsock2.h header file.


 
moor38   (2004-03-12 19:47) [6]

что-то на эту структуру ма...ся delphi


 
Rouse_ ©   (2004-03-12 20:24) [7]

http://www.delphimaster.ru/cgi-bin/download.pl?look=1&id=1078646471&n=1


 
Raptor   (2004-03-18 17:06) [8]

В приложении к Indy:

procedure TForm1.IdTCPServer1Connect(AThread: TIdPeerThread);
var IP         : string;
   SockAddrIn : TSockAddrIn;
   Size       : Integer;
   HostEnt    : PHostEnt;

begin
  IP:=AThread.Connection.Socket.Binding.PeerIP;

  Size:=SizeOf(SockAddrIn);
  getpeername(AThread.Connection.Socket.Binding.Handle, SockAddrIn, Size);
  HostEnt:=gethostbyaddr(@SockAddrIn.sin_addr.s_addr, 4, PF_INET);

  ListBox1.Items.Add(IP+" - "+HostEnt.h_name)
end;



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

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

Наверх




Память: 0.48 MB
Время: 0.027 c
1-1079945518
Grihan
2004-03-22 11:51
2004.04.11
Доступ к событиям вложенного объекта через инспектор объектов.


7-1079534916
Arm79
2004-03-17 17:48
2004.04.11
Создание форм в потоках


1-1082549015
Igor G
2004-04-21 16:03
2004.04.11
Chartfx


14-1078597165
Marser
2004-03-06 21:19
2004.04.11
Только что Луну рассматривал в трубу


11-1061879516
Maxim Pshevlotsky
2003-08-26 10:31
2004.04.11
Как создать библиотеку