使用jpcap 获得硬件信息 我的代码有错吗 我写的一个测试 但是没有结果阿
我的编译调试环境是debian lenny 5.0 下:jpcap的开发环境以搭建好。源码如下,一个测试:
1 import jpcap.*;
2
3 public class Devices {
4 public static void main(String []args) {
5 NetworkInterface []devices = JpcapCaptor.getDeviceList();
6
7 try{
8 for(int i=0; i<devices.length; i++) {
9 System.out.println(devices[i].name); //这里的本意是得到网络界面的名字但什么都没有
10 }
11 } catch(ArrayIndexOutOfBoundsException e) {
12 System.out.println("this array is out");
13 }
14 }
15 }
小弟在此请教了,麻烦各位了。