简体   繁体   English

Windows 7(32位)上的Jpcap

[英]Jpcap on windows 7 (32 bit)

I have Windows 7 (32 bit) installed on my Laptop. 我的笔记本电脑上安装了Windows 7(32位)。 I am running the below code on Eclipse Juno : 我在Eclipse Juno上运行以下代码:

import jpcap.JpcapCaptor;     
import jpcap.NetworkInterface;

public class Network {

   public static void main(String[] args) {

   NetworkInterface[] devices = JpcapCaptor.getDeviceList();

   System.out.println("No. of Network devices : "+devices.length);    
   }    
}

I have 2 network adapters and have administrative privileges 我有2个网络适配器并具有管理权限

But I get the result as: No. of Network devices : 0 但我得到的结果为: No. of Network devices : 0

Can someone please help with what could be issue? 有人可以帮助解决可能存在的问题吗?

Ok. 好。 I finally got the answer. 我终于得到了答案。 Just having the user account with administrative privileges is not enough, I still had to right click on eclipse and select "Run as administrator" and then when I execute the above program, I get the correct no. 仅仅拥有具有管理权限的用户帐户是不够的,我仍然必须右键单击eclipse并选择“以管理员身份运行”,然后当我执行上述程序时,我得到正确的号码。 of network devices 网络设备

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM