Hello I am having a dikens of a time getting my IP address on the machine
that I am working on.  I've looked in the mailing list and I found something
that I've been toying with but still I cannot get the xxx.xxx.xxx.xxx style
name I can only get my machine name.  Here's what I have which I can get the
names but not the byte code address.
I know how to do this in python gethostbyname(gethostname()) by I'm having a
hard time with this.
program get_ip;
uses sockets,winsock;
const
        len:integer=256;
var 
        lsock,y,z:longint;
        ac: array[0..255] of char;
        phe:phostent;
        xs:pchar;
        Adder:TInetSockAddr;


begin 
        writeln(gethostname(ac,len));
        writeln(ac);
        phe:=gethostbyname(ac);
        xs:=phe^.h_addr_list[1];
        writeln(xs);
        phe:=gethostbyaddr(ac,4,PF_INET);
        xs:=phe^.h_name;
        writeln(xs)
        
end.
        

-------------------------------------------------------------------------------------------
***National City made the following annotations
-------------------------------------------------------------------------------------------

This communication is a confidential and proprietary business communication.
It is intended solely for the use of the designated recipient(s).  If this
communication is received in error, please contact the sender and delete this
communication.
===========================================================================================

_______________________________________________
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to