-5

I have WCF service hosted as windows service, I am trying to get clients (WPF client) Mac address at server end (WCF side). I have tried using following line of code but it gives me IP address of client that too in ::1 format. RemoteEndpointMessageProperty prop = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;

prop.Address is ::1

How can I get client Mac address so that I can differentiate among the client hitting my service. There could be scenarios where clients under same network may give me same IP address and that is reason I am looking for Mac address to identity client's call..

This question got closed and marked duplicate however its not something related to IP address. I am looking for Mac address!!! Please let answers come and don't close this!!!

NP_22
  • 49
  • 5

1 Answers1

0

You can only get MAC address on the same subnet as the sever so it will not be more unique than client IP.

There is no dotnet API to get the address within the same subnet but if you really want you can try running an external program and captiapturr the output, see options listed

https://superuser.com/questions/188799/how-to-find-the-mac-address-of-a-remote-computer

Doncarleone512
  • 346
  • 1
  • 7