简体   繁体   中英

Gathering client information (IP address and MAC Address)

I'am creating a LAN chat application. I already created the client and the server part of the application.

What I want to know is how can my server display the information of the host that are connected to it. For example if there are 5 clients that are connected to the server, I want the server to gather the information of each client like IP address or its MAC address? Can anyone there help with this problem?

I'm guessing you're not working with ASP.NET, in which case you could get at least the IP Address by using the Request object properties.

Some information can be found here:

Reliable method to get machine's MAC address in C#

Identifying the client during a .NET remoting invocation

You would have to get the server to ask the client what its IP / MAC address is.

See this for getting your IP How to get the IP address of the server on which my C# application is running on?

I think you could find something similar for MAC

In order to better answer your question, how are the clients and servers communicating?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM