get user ip
Does anyone know a function to return the users current ip address like
"127.0.0.1" (abvioulsy that is loopback address but you get the point)
as a char array or something i can convert to a char array (string, CString, etc)
I want to be able to display the users ip address to him.
"I pity the fool, thug, or soul who tries to take over the world, then goes home crying to his momma."
- Mr. T
Since I''d really like to know the answer to this also, I''ll bump this back up
. <bump>
"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said

http://druidgames.cjb.net/

"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said

http://druidgames.cjb.net/
Depends.
A script running on a web server can return the REMOTE_ADDR property from the server environmental variables.
A script running on a web server can return the REMOTE_ADDR property from the server environmental variables.
Where do you want to do this? ( ie from a webpage, from DirectPlay, from Winsock ... )
If it''s from winsock then just use the inet_ntoa() function.
-------
Andrew
If it''s from winsock then just use the inet_ntoa() function.
-------
Andrew
char FAR * inet_ntoa (
struct in_addr in
);
ok....but how do i fill in the in_addr if i dont know what their address is ?
"I pity the fool, thug, or soul who tries to take over the world, then goes home crying to his momma."
- Mr. T
struct in_addr in
);
ok....but how do i fill in the in_addr if i dont know what their address is ?
"I pity the fool, thug, or soul who tries to take over the world, then goes home crying to his momma."
- Mr. T
This should get all the user's IP's except the localhost. Put them in a null terminated string. WinSock should be initialized first:
Good luck,
Jasper
Edited by - JasperW on April 9, 2001 5:35:57 PM
|
Good luck,
Jasper
Edited by - JasperW on April 9, 2001 5:35:57 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement