问题
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.
回答1:
Quick question: are you able to work with/modify the WPF code?
My thought is you could have the WPF client generate a unique code upon initialization, and include that along with each of its requests to the server.
来源:https://stackoverflow.com/questions/66143909/get-clients-mac-address-at-server-side-in-wcf-service-c