| 发表于:2007-01-18 21:36:128楼 得分:0 |
char localname[ 80 ] = {0}; int ret = 0; if ( gethostname( localname, sizeof( localname ) ) == socket_error ) { return false; } struct hostent *phe = gethostbyname( localname ); int count = 0; while(phe-> h_addr_list[count]!=0) count++; ....... | | |
|