can anytell tell how to get the IP address of a computer using vc++?
Printable View
can anytell tell how to get the IP address of a computer using vc++?
[ Moved thread ]
Take a look at the following FAQ...
you will probably need to store it in a sockaddr_in.... look here
basically, "INADDR_ANY" will give you the ip address.. play around with it to do what you want with it..Code:SOCKADDR_IN serverInfo;
serverInfo.sin_family = AF_INET;
serverInfo.sin_addr.s_addr = INADDR_ANY; // Since this socket is listeningfor connections,
// any local address will do
serverInfo.sin_port = htons(nPort); // Convert integer 8888 tonetwork-byte order
editing: sorry! i misread your post.. i thought you wanted to get the local ip address! but check out section 3.2 (and some of the stuff after that too...) at http://www.tutorialized.com/tutorial...et-Sockets/456
Can you expand on that? Do you want to use DNS? What?
ahoodin