VC获取主机名和主机信息

int gethostname(
  char FAR
*name, 
  int namelen      
);

 

struct hostent FAR *gethostbyname(
  const char FAR *name 
);

 

struct hostent {
  char FAR *       h_name;
  char FAR * FAR * h_aliases;
  short            h_addrtype;
  short            h_length;
  char FAR * FAR * h_addr_list;
};

 

详查MSDN

你可能感兴趣的:(VC)