IP ADRESS
-
how to get syetem ip addres in an dialog box i use ipadress control for that but can somebody tell me wat code i write on a button to get ip address of the sytem Ashish Dogra MCA Noida
-
how to get syetem ip addres in an dialog box i use ipadress control for that but can somebody tell me wat code i write on a button to get ip address of the sytem Ashish Dogra MCA Noida
gethostname() for getting name of system and then call gethostbyname() See MSDN for more help on these function Regards Abhishake Lahare
-
how to get syetem ip addres in an dialog box i use ipadress control for that but can somebody tell me wat code i write on a button to get ip address of the sytem Ashish Dogra MCA Noida
Hi jigar . void GetIPAddress(char *ipAddress) { #define MAX_NAME_LEN 65 WSADATA wsaData; if ( WSAStartup( MAKEWORD( 2, 2 ), &wsaData ) == 0 ) { char HostName[MAX_NAME_LEN]; struct in_addr *ptr; gethostname (HostName,MAX_NAME_LEN); hostent *host = gethostbyname(HostName); if(host == NULL) { ipAddress = NULL ; WSACleanup( ); return ; } ptr = (struct in_addr *)host->h_addr_list[0]; CString str; str.Format("%d.%d.%d.%d", ptr->S_un.S_un_b.s_b1, ptr->S_un.S_un_b.s_b2, ptr->S_un.S_un_b.s_b3, ptr->S_un.S_un_b.s_b4); strcpy(ipAddress,(char*)str.GetString()); } WSACleanup( ); }
-
gethostname() for getting name of system and then call gethostbyname() See MSDN for more help on these function Regards Abhishake Lahare
thanks but can you tell me what are parameters in the gethostname() as a code to help me Ashish Dogra MCA Noida
-
how to get syetem ip addres in an dialog box i use ipadress control for that but can somebody tell me wat code i write on a button to get ip address of the sytem Ashish Dogra MCA Noida