Member Avatar

Hi, i have csharp server(console application) and java client. I need to get a java client ipaddress, can someone tell me what is the function in csharp? I am new in csharp. I was searching on web and nothing help me.

Recommended Answers

you could always call netstat. that'll give you the ip of every machine connected to yours, and also the stat of that connection.

Jump to Post

All 2 Replies

you could always call netstat. that'll give you the ip of every machine connected to yours, and also the stat of that connection.

You can obtain the client IP address with the following call:

string clientConnection = ((IPEndPoint)tcpClient.Client.RemoteEndPoint).Address.ToString();

where tcpClient is your TCPClient object.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.