如何ping局域网中的mac地址? C ++窗口 [英] How do I ping a mac address in LAN? C++ windows

查看:846
本文介绍了如何ping局域网中的mac地址? C ++窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检查mac地址是否连接到本地网络。我认为ping它是最好的选择。



我尝试过:



向所有ips发送ARP请求,然后检查我正在寻找哪个mac,但它不是那么有效。

I need to check if mac address is connected to local network. I think pinging it is the best option.

What I have tried:

Sending ARP request to all ips and then checking which is mac I'm looking for, but it's not so effective.

推荐答案

可能你最好的选择是检索LAN网段上的所有MAC地址,并手动比较它们。

这不是很难做到:检索LAN的IP和MAC地址 [ ^ ]显示了它是如何使用C#而不是C ++,但它都是通过调用非托管方法实现的,因此应该很容易转换为C ++。
Probably your best bet is to retrieve all the MAC addresses on the LAN segment, and compare them manually.
That's not too difficult to do: Retrieving IP and MAC addresses for a LAN[^] shows how - it's in C# rather than C++, but it's all via calls to unmanaged methods, and as such should be simple to convert to C++.


这篇关于如何ping局域网中的mac地址? C ++窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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