Hi,
I try to fined function how get the IP address of my local machine, but
nothing found.
Which function I need to use for getting my IP address of my local machine.
thank you in advanced.
thank you in advanced.
http://cui.unige.ch/OSG/people/Past/fuentes/Mfc/HowTo_48.html
Cheers
Check Abdoul
-----------------
Quote:> Hi,
> I try to fined function how get the IP address of my local machine, but
> nothing found.
> Which function I need to use for getting my IP address of my local
machine.
> thank you in advanced.
machine.Quote:> Hi,
> I try to fined function how get the IP address of my local machine, but
> nothing found.
> Which function I need to use for getting my IP address of my local
// Retrieve IP adres.
char szBuffer[256];
CString ipadres(_T("0.0.0.0"));
WSADATA WSAData;
WORD wVersionRequested = MAKEWORD( 2, 0 );
if(WSAStartup(wVersionRequested, &WSAData) == 0)
{
if(gethostname(szBuffer, sizeof(szBuffer)) == 0)
{
HOSTENT* h=gethostbyname(szBuffer);
ipadres = inet_ntoa(*(IN_ADDR*) h->h_addr);
}
WSACleanup();
Hope this helpsQuote:}
TiTi
> // Retrieve IP adres.
> char szBuffer[256];
> CString ipadres(_T("0.0.0.0"));
> WSADATA WSAData;
> WORD wVersionRequested = MAKEWORD( 2, 0 );
> if(WSAStartup(wVersionRequested, &WSAData) == 0)
> {
> if(gethostname(szBuffer, sizeof(szBuffer)) == 0)
> {
> HOSTENT* h=gethostbyname(szBuffer);
> ipadres = inet_ntoa(*(IN_ADDR*) h->h_addr);
> }
> WSACleanup();
> }
> Hope this helps
> TiTi
1. How to get local MAC address and local IP address?
How to get local MAC address and local IP address? I know
there are any functions in iphlpapi.lib, but they work
only under Windows Whisler.
Any suggest will be appreciated.
Sky.
3. LOCAL IP ADDRESS (MY IP ADDRESS)
5. IP address of local machine.
6. Wanted: FTP library functions
7. How to get IP address of local machine
9. Getting IP of local machine
10. local machine's ip address
11. Getting Client requested IP address in case of multiple Ip addresses
12. Getting local IP address of a socket connection
13. How about a fool-proof method for getting the local IP address!