|
-
January 19th, 2005, 11:35 PM
#1
Ip Adress
can anytell tell how to get the IP address of a computer using vc++?
-
January 20th, 2005, 09:43 AM
#2
-
January 20th, 2005, 09:44 AM
#3
Re: Ip Adress
Take a look at the following FAQ...
-
January 20th, 2005, 11:55 AM
#4
Re: Ip Adress
you will probably need to store it in a sockaddr_in.... look here
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
basically, "INADDR_ANY" will give you the ip address.. play around with it to do what you want with it..
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
Last edited by drewdaman; January 20th, 2005 at 05:46 PM.
-
January 20th, 2005, 03:44 PM
#5
Re: Ip Adress
Can you expand on that? Do you want to use DNS? What?
ahoodin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|