C# – web server to fetch client’s machine mac address

asp.netc++iis

I'm trying to build some complicated stuff for an C# winform application being build online and trying to gather some information here and there.I've looked on the web that it's possible to get a mac address of a computer on the network using either System.Net.NetworkInformation or System.Management.ManagementClass(which i can't reference for some reasons).Where are my worries

  1. Can my web server online know the mac address of a client's machine connected to it?
  2. If question 1 is true i guess it will use IP (correct me if I'm wrong) what if client's machine is sitting behind a proxy server or using multiple web proxy?
  3. if question 1 and 2 are positive How to do that from the web server.

Best Solution

No, there's no easy way to do that.

The MAC address is only resolvable on the same subnet - assuming this isn't a fairly small intranet app, you would not be on the same subnet as your clients.

In theory, querying the client with remote WMI would work - but the firewall and permission issues are non-trivial. Again, unless you can control all clients - you're not likely to have success here.

About the only thing you could do is a downloadable app - possibly Flash, Silverlight or ActiveX - that interrogated the local machine for you. I'm not sure if that info would be sandboxed by the browser though.

My guess is there's an easier way to do what you're trying to do - but you'd need to provide more details on why you want the MAC address.