|
-
Aug 7th, 2006, 05:01 PM
#1
Thread Starter
New Member
Getting the IP
How can I get the IP of the client? I have the code setup like this;
VB Code:
CData.structSocket = Server_Tcp.AcceptSocket()
Interlocked.Increment(connectId)
CData.structThread = New Thread(AddressOf ReadSocket)
CData.SelfID = connectId
Do i need something extra?
-
Aug 8th, 2006, 09:03 AM
#2
Fanatic Member
Re: Getting the IP
 Originally Posted by Mr_mo
How can I get the IP of the client? I have the code setup like this;
VB Code:
CData.structSocket = Server_Tcp.AcceptSocket()
Interlocked.Increment(connectId)
CData.structThread = New Thread(AddressOf ReadSocket)
CData.SelfID = connectId
Do i need something extra?
hmm you may want to post just a wee bit more of your code to demonstrate exactly what you're trying to do.
-
Aug 12th, 2006, 02:01 AM
#3
Hyperactive Member
Re: Getting the IP
Did you want the internal or external ip?
KAZAR
The Law Of Programming:
As the Number of Lines of code increases, the number of bugs generated by fixing a bug increases exponentially.
__________________________________
www.startingqbasic.co.uk
-
Aug 14th, 2006, 08:20 AM
#4
Member
Re: Getting the IP
try this
using system.net;
string hostname = Dns.GetHostName();
IPHostEntry local = Dns.GetHostByName(hostname);
local.AddressList.GetValue(0);
MessageBox.Show(local.AddressList.GetValue(0).ToString());
venkat
Strength is Life, Weakness is Death
- Swami Vivekananda
-
Aug 14th, 2006, 12:11 PM
#5
Fanatic Member
Re: Getting the IP
 Originally Posted by nvenkat75
try this
using system.net;
string hostname = Dns.GetHostName();
IPHostEntry local = Dns.GetHostByName(hostname);
local.AddressList.GetValue(0);
MessageBox.Show(local.AddressList.GetValue(0).ToString());
one could suspect that the user requesting help is asking how to retrieve the IP address of clients connecting to a server.. not his own local IP address
though as I stated above, they need to provide some more of their source code.
we need to know what they are using to implement their server.
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
|