How do i get my comp's ip ?
-
Hi, is there any function which tells me what ip has the machine ? (i dont mean 127.0.0.1 ;)). Thanks
-
Hi, is there any function which tells me what ip has the machine ? (i dont mean 127.0.0.1 ;)). Thanks
GetMyIp(void) const { // Don't forget to initialize the sockets and stuff! char locn[255]; CString ip; if (SOCKET_ERROR != gethostname(locn, 255)) ip = inet_ntoa(*(struct in_addr *)*gethostbyname(locn)->h_addr_list); return ip; } Bryce --- Publitor, making Pubmed easy. http://www.sohocode.com/publitor
-
GetMyIp(void) const { // Don't forget to initialize the sockets and stuff! char locn[255]; CString ip; if (SOCKET_ERROR != gethostname(locn, 255)) ip = inet_ntoa(*(struct in_addr *)*gethostbyname(locn)->h_addr_list); return ip; } Bryce --- Publitor, making Pubmed easy. http://www.sohocode.com/publitor
That was pretty fast reply :) Thanks