本文介绍了当任何人在浏览器中输入网站名称时,获取MAC地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人在浏览器中输入网站名称时如何获取MAC地址.

how to Get MAC address when any one enter website name in the browser.

推荐答案



public static string GetClientIPAddress(System.Web.HttpRequest httpRequest)

{

    string OriginalIP = string.Empty;

    string RemoteIP = string.Empty;

    OriginalIP = httpRequest.ServerVariables["HTTP_X_FORWARDED_FOR"]; //original IP will be updated by Proxy/Load Balancer.

    RemoteIP = httpRequest.ServerVariables["REMOTE_ADDR"]; //Proxy/Load Balancer IP or original IP if no proxy was used

    if (OriginalIP != null && OriginalIP.Trim().Length > 0)

    {
        return OriginalIP + "(" + RemoteIP + ")"; //Lets return both the IPs.

    }
    return RemoteIP;

}


这篇关于当任何人在浏览器中输入网站名称时,获取MAC地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 13:18