0

We have three computers, all in the same network.

I need to get the MAC Address of these computers when the users connect to my web application. The users use these three computers.

I've tried with:

Function getMacAddress()
        Dim nics() As NetworkInterface =
              NetworkInterface.GetAllNetworkInterfaces
        Return nics(0).GetPhysicalAddress.ToString
    End Function

But, that code returns the MAC Address of the server.

Thanks.

The solution in: Get a machines MAC address on the local network from its IP in C# throws me the same error: I got the IP address and MAC address of the server.

  • 1
    Possible duplicate of [Get a machines MAC address on the local network from its IP in C#](https://stackoverflow.com/questions/12802888/get-a-machines-mac-address-on-the-local-network-from-its-ip-in-c-sharp) – Joseph Sible-Reinstate Monica Jun 19 '19 at 20:32
  • No, that solution throws me the same error, I got the server ip address and mac address – Felicity Stark Jun 19 '19 at 20:56
  • [How do I obtain the physical (MAC) address of an IP address](https://stackoverflow.com/a/187929/7444103). – Jimi Jun 20 '19 at 00:30
  • @pramos Did you apply the suggested method to [`Request.UserHostAddress`](https://stackoverflow.com/a/8756278/11683), like you should have? – GSerg Jun 20 '19 at 06:42
  • Yes, but that method returns only the mac of the devices connected to the same vlan The server vlan is 10.10.10.X All the devices in 10.10.10.x returns their mac addressess. The devices in 10.10.30.X doesn't The devices in 172.X.X.X doesn't All the devices are in the same intranet. @GSerg – Felicity Stark Jun 25 '19 at 19:07
  • @pramos That sounds [about right](https://serverfault.com/a/36003/56843). – GSerg Jun 25 '19 at 19:32

0 Answers0