Detect machine name, IP address and domain name

Detect machine name, IP address and domain name

Post by Rocky Le » Wed, 23 Oct 2002 12:12:06



Hi all,
I need some APIs that can help me to detect the machine name, IP address and
domain name of the current computer, the computer that my program is
running.
I know that GetNetworkParams() work for Win98/Win2K/WinXP, but not for
WinNT4.0. Could someone give me some advice?
Thank you very much,
Rocky Lee
 
 
 

Detect machine name, IP address and domain name

Post by arkady » Wed, 23 Oct 2002 15:05:43


You can use gethostname() - machine name
gethostbyname() with name before to receive IP
and NetWkstaGetInfo()  to receive domain
Arkady


Quote:> Hi all,
> I need some APIs that can help me to detect the machine name, IP address
and
> domain name of the current computer, the computer that my program is
> running.
> I know that GetNetworkParams() work for Win98/Win2K/WinXP, but not for
> WinNT4.0. Could someone give me some advice?
> Thank you very much,
> Rocky Lee