método de dirección IP de visualización vc
Prueba vs2010 aprobada
#includelt;winsock2.hgt;
#pragma comment(lib, "ws2_32.lib")
void CLoginDlg::OnBnClickedButton2()
{ // TODO: Agregue el código del controlador de notificación de control aquí WSADATA wsaData; char name[155]; PHOSTENT hostinfo if ( WSAStartup( MAKEWORD(2 , 0 ) ), & wsaData ) == 0 ) { if( gethostname ( nombre, tamaño de (nombre)) == 0) { if((hostinfo = gethostbyname(nombre)) != NULL) { ip = inet_ntoa(*( struct in_addr* )*hostinfo-gt;h_addr_list); char str[16]; sprintf(str, "Su IP es: s\n", ip); :: MessageBoxA(NULL, str, "Prompt", MB_OK) ; ( ); }
}