2
我想获取另一台计算机的MAC地址,我该怎么做?我使用JPCAPmac地址问题
private void getPackage(JpcapCaptor captor)
{
try{
IPPacket ip = (IPPacket)captor.getPacket();
for(int a =0 ; a <found.size(); a++)
{
if(ip.dst_ip.equals(found.get(a)))
check = true;
}
if(!check)
{
if(ip.dst_ip.isSiteLocalAddress())
{
host = ip.dst_ip.getHostName();
System.out.println("destination ip : " + ip.dst_ip + " " + ip.dst_ip.getHostName());
System.out.println("Source ip : " + ip.src_ip + " " + ip.src_ip.getHostName());
found.addElement(ip.dst_ip);
}
}
check = false;
}catch(Exception ex)
{
//Sys.alert("Error" ,"lobby exeption :" + ex);
//wegens null reverence exeption
}
}
这个代码只是获取IP地址,但我想MAC地址太
我希望它的工作。无法看到获得该库以列出我的接口。 –
su - 做了窍门omg –