如何在asp.net中获取客户端系统的mac地址 [英] How to get the mac address of client system in asp.net

查看:270
本文介绍了如何在asp.net中获取客户端系统的mac地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,

我正在使用c#开发asp.net中的web应用程序,我想存储客户端的客户端mac地址

Dear sir,
I am developing on web application in asp.net using c#, I want to store the client mac address of client

推荐答案

public string fnGetClientIP()
{
    string ClientIP= string.Empty;
    string ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
    if (!string.IsNullOrEmpty(ip))
    {
        string[] ipRange = ip.Split(',');
        int le = ipRange.Length - 1;
        ClientIP = ipRange[0];
    }
    else
    {
        ClientIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
    }

    return ClientIP;
}


请查看以下有用链接以探索概念。

1. 使用C#获取客户端计算机的MAC地址 [ ^ ] 。

2. 如何在ASP.Net中获取访客机器的IP地址 [ ^ ]。

3. 使用Internet Explorer的高级JavaScript:检索网络配置信息rmation - 如何使用JavaScript检索MAC地址和其他扩展网络信息 [ ^ ]。

4. 客户端MAC地址 [ ^ ]。
Please check these below useful links to explore the concepts.
1. Get MAC address of client machine using C#[^].
2. How to get IP Address of Visitors Machine in ASP.Net[^].
3. Advanced JavaScript with Internet Explorer: Retrieving Networking Configuration Information - How to retrieve MAC address and other extended network information using JavaScript[^].
4. Client MAC address[^].


你提供了获取客户端[访问者]的ip但我需要客户端pc的物理地址而不是ip地址。主机提供商的网络策略阻止获取物理地址[mac地址]。如何使用web.config文件处理此问题。这是主要问题。
you are providing to get ip of client[visitors] but i need the physical address of client pc instead of ip address. getting of physical address[ mac address] was prevented by network policies of hosting provider. how to handle this using web.config file. this is the main question.


这篇关于如何在asp.net中获取客户端系统的mac地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆