Peter,

Hi.  Unfortunately there is no short answer.

You will need to call gethostname, pass the return value to gethostbyname.
This returns a pointer to the hostent structure.  The h_addr_list member of
this structure points to list of pointers that point to the list of IP
addresses that have been assigned to the local machine.  You will then need
to loop through these addresses and see if your IP address is in the list.
Be careful about network / i386 byte ordering.

HTH,
Dennis.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 21 June 2001 14:26
> To: Multiple recipients of list delphi
> Subject: [DUG]: A function to test: is this my IP #?
>
>
> Hi folks,
>   Does someone perchance know of a function available in the
> Windows or WinInet APIs which allows me to ask "is this one of
> the IP numbers configured for THIS computer"?
>
> Something like:  isLocalIPNumber(const IP: string): Boolean
>
>
> cheers,
> peter
>
> ============================================
> Peter Hyde, WebCentre Ltd & SPIS Ltd, Christchurch, New Zealand
> * Web automation for online periodicals: http://TurboPress.com
> * TurboNote+: http://TurboPress.com/tbnote.htm
>   -- handy onscreen notes and instant messaging
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to