【问题标题】:Get Client's Mac address at server side in WCF service C# Not a duplicate of (Obtaining client IP address in WCF 3.0)在 WCF 服务 C# 的服务器端获取客户端的 Mac 地址不重复(在 WCF 3.0 中获取客户端 IP 地址)
【发布时间】:2021-05-14 15:00:28
【问题描述】:

我将 WCF 服务托管为 Windows 服务,我试图在服务器端(WCF 端)获取客户端(WPF 客户端)Mac 地址。我尝试使用以下代码行,但它也以 ::1 格式为我提供了客户端的 IP 地址。 RemoteEndpointMessageProperty prop = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;

prop.Address 是 ::1

如何获取客户端 Mac 地址,以便区分访问我的服务的客户端。在某些情况下,同一网络下的客户端可能会给我相同的 IP 地址,这就是我正在寻找 Mac 地址来识别客户端呼叫的原因..

此问题已关闭并标记为重复,但它与 IP 地址无关。我在找Mac地址!!!请让答案来,不要关闭这个!!!

【问题讨论】:

    标签: c# wpf wcf client-server mac-address


    【解决方案1】:

    您只能在与服务器相同的子网中获取 MAC 地址,因此它不会比客户端 IP 更唯一。

    没有 dotnet API 来获取同一子网内的地址,但如果您真的需要,可以尝试运行外部程序并捕获输出,请参阅列出的选项

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-10
      • 2011-07-15
      • 1970-01-01
      • 1970-01-01
      • 2017-01-17
      • 2023-04-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多