Get a machines MAC address on the local network from its IP in C#(从 C# 中的 IP 获取本地网络上的机器 MAC 地址)
问题描述
我正在尝试编写一个函数,它将单个 IP 地址
作为参数,并在我的本地网络上查询该机器的 MAC 地址
.
I am trying write a function that takes a single IP address
as a parameter and queries that machine on my local network for it's MAC address
.
我见过很多获取本地机器自己的MAC地址
的例子,但是没有一个(我发现)似乎查询本地网络机器.
I have seen many examples that get the local machine's own MAC address
, however none (I've found) that seem to query a local network machine for it.
我知道这样的任务是可以完成的,因为这个 Wake on LAN 扫描仪 软件会扫描本地 IP 范围并返回机器上所有机器的 MAC 地址/主机名.
I know such a task is achievable as this Wake on LAN scanner software scans the local IP range and returns MAC address/Hostname of all on machines.
谁能告诉我从哪里开始尝试编写一个函数来在 C# 中实现这一点?任何帮助,将不胜感激.谢谢
Can anyone tell me where I'd get started trying to write a function to achieve this in C#? Any help would be appreciated. Thanks
根据下面 Marco Mp 的评论,使用了 ARP 表.arp 类
As per Marco Mp's comment below, have used ARP tables. arp class
推荐答案
根据上面 Marco Mp 的评论,使用了 ARP 表.arp 类
As per Marco Mp's comment above, have used ARP tables. arp class
这篇关于从 C# 中的 IP 获取本地网络上的机器 MAC 地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 C# 中的 IP 获取本地网络上的机器 MAC 地址


基础教程推荐
- 全局 ASAX - 获取服务器名称 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01