Get Client's Mac address at server side in WCF service C#\ [duplicate]

陌路散爱 提交于 2021-02-11 06:53:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!