API:
GetHostNameThe Windows Sockets gethostname function returns the standard host name for the local machine.int gethostname ( char FAR * name,
int namelen
);
Parametersname[out] A pointer to a buffer that will receive the host name.namelen[in] The length of the buffer.
GetHostNameThe Windows Sockets gethostname function returns the standard host name for the local machine.int gethostname ( char FAR * name,
int namelen
);
Parametersname[out] A pointer to a buffer that will receive the host name.namelen[in] The length of the buffer.
var
name : array [0..255] of char
len : integer;
begin
len := 256;
GetComputerName(name,len);
showMessage(name);
end;
gethostbyname 可以得到机器的ip地址