Dec 17, 2001 #1 Ed2020 Programmer Nov 12, 2001 1,899 GB Hi, I'm looking for some code to return the user's IP address. I've searched high and low but can't find any way of doing it. Anybody got any ideas? Ed Metcalfe. ed_metcalfe@hotmail.com
Hi, I'm looking for some code to return the user's IP address. I've searched high and low but can't find any way of doing it. Anybody got any ideas? Ed Metcalfe. ed_metcalfe@hotmail.com
Dec 17, 2001 1 #2 JGillespie Instructor Jul 3, 2001 174 GB Place a Winsock control on your form (it will be hidden at runtime so it does not matter where you put it)and set it's name to Winsock1. With this on your form you can now get the IP address by using the following code: MyIPAddress = Winsock1.LocalIp Do what you will then with the variable MyIPAddress. HTH Jamie Gillespie j-gillespie@s-cheshire.ac.uk Upvote 0 Downvote
Place a Winsock control on your form (it will be hidden at runtime so it does not matter where you put it)and set it's name to Winsock1. With this on your form you can now get the IP address by using the following code: MyIPAddress = Winsock1.LocalIp Do what you will then with the variable MyIPAddress. HTH Jamie Gillespie j-gillespie@s-cheshire.ac.uk
Dec 17, 2001 Thread starter #3 Ed2020 Programmer Nov 12, 2001 1,899 GB Thanks Jamie. Have a purple star! Does anybody know a way of doing it without having a specific form open with a WinSock control on it? Ed Metcalfe ed_metcalfe@hotmail.com Upvote 0 Downvote
Thanks Jamie. Have a purple star! Does anybody know a way of doing it without having a specific form open with a WinSock control on it? Ed Metcalfe ed_metcalfe@hotmail.com
Dec 17, 2001 #4 JGillespie Instructor Jul 3, 2001 174 GB Try this link: http://www.mvps.org/vbnet/index.html?code/network/ipaddress.htm Does what you want with API calls. As you can see though it is FAR more involved than my previous suggestion. HTH Jamie Gillespie j-gillespie@s-cheshire.ac.uk Upvote 0 Downvote
Try this link: http://www.mvps.org/vbnet/index.html?code/network/ipaddress.htm Does what you want with API calls. As you can see though it is FAR more involved than my previous suggestion. HTH Jamie Gillespie j-gillespie@s-cheshire.ac.uk