如何通过使用服务器端语言获取客户端MAC地址 [英] how to get Client MAC address by using server side language

查看:385
本文介绍了如何通过使用服务器端语言获取客户端MAC地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取连接的客户端mac ID(物理地址)

我如何通过使用服务器端语言(如C#,VB.net和asp.net)做到这一点

i want to get connected client mac ID (Physical address)

How can i do this by using server side language like C#,VB.net with asp.net

推荐答案

看看这是否可以帮助您

http://codingresource.blogspot.com/2010/02/get-client-mac-address-ip-address-using.html [ http://answers.yahoo.com/question/index?qid=20070622094940AA1e1B2 [ ^ ]
See if this can help you

http://codingresource.blogspot.com/2010/02/get-client-mac-address-ip-address-using.html[^]
http://answers.yahoo.com/question/index?qid=20070622094940AA1e1B2[^]


您可以使用以下代码获取客户端的IP地址,

You can get client''s IP address using following code,

Request.UserHostAddress


MAC地址不在客户端请求标头中,因此您唯一拥有的客户端要使用的IP地址.除非服务器与客户端位于同一网段,否则无法获取客户端的MAC地址.

将会发生的是,您将获得客户端的IP地址,尝试使用ARP将其解析为MAC,但是随后您发现返回的MAC对于几乎所有客户端都是相同的(取决于网络布局),它是路由器近端接口的MAC.这是从服务器到客户端的第一跳.
The MAC address isn''t in the client request headers, so the only thing you''ve got in the clients IP address to use. You can''t get the MAC address of the client unless the server is on the same network segment as the client.

What''ll happen is you''ll get the clients IP address, try to resolve it to a MAC using ARP, but then you''ll find that the MAC you get back is the same for just about all of your clients (depending on network layout) and it''s the MAC for the routers near-side interface. This is the first hop from the server back to the client.


这篇关于如何通过使用服务器端语言获取客户端MAC地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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