2
A
回答
0
我想你应该通过java Runtime.getRuntime().exec(command);
尝试命令行根据这个网站http://michaelminn.com/linux/command_line 下面的命令应该返回此:
lspci: Lists information about devices connected to the internal PCI busses.
lspci -vv: Full dump of information.
所以
String command="lspci";
而且从你可能需要的窗口下载DevCon命令! http://support.microsoft.com/kb/311272/EN-US
所以
String command="devcon find";
2
要查找USB设备连接到您可以使用jUSB系统。这article有关如何使用API的更深入的信息。特别是,要找到所有USB设备(从文章稍作修改):
Host host = HostFactory.getHost();
// Obtain a list of the USB buses available on the Host.
Bus[] bus = host.getBusses();
// Traverse through all the USB buses.
for (int i = 0; i < bus.length; i++) {
// Access the root hub on the USB bus and obtain the number of USB ports available on the root hub.
Device root = bus[i].getRootHub();
int totalPorts = root.getNumPorts();
// Traverse through all the USB ports available on the
// root hub. It should be mentioned that the numbering
// starts from 1, not 0.
for (int j=1; j<=total_port; j++) {
// Obtain the Device connected to the port.
Device device = root.getChild(j);
if (device != null) {
// USB device available, do something here.
}
}
}
同样,你可以使用API的MIDI系统找到MIDI设备连接的东西,看到the java tutorials以获取更多信息。
相关问题
- 1. 如何验证使用opentok连接到系统的设备
- 2. 如何在Haskell中接收设备/系统输入?
- 3. 如何知道设备连接到WiFi或3G,编程
- 4. 我如何知道iOS设备现在连接到互联网?
- 5. 查找通过ASP.NET网页连接到系统的输入设备
- 6. android系统如何自动连接到配对设备?
- 7. 如何检查设备是否连接到系统?
- 8. pos explorer没有找到任何设备连接到C#系统#
- 9. 系统通知 - iOS设备
- 10. 如何知道连接的USB设备的速度?
- 11. SWT:获取系统设备更改通知(USB设备连接/断开)
- 12. 如何知道特定的蓝牙设备正在连接?
- 13. 如何知道设备是否有数据连接?
- 14. 如何知道设备?
- 15. jcifs.smb.SmbException:连接到系统的设备无法正常工作
- 16. 无法连接android设备到eclipse上的linux系统
- 17. JCIFS jcifs.smb.SmbException:连接到系统的设备无法运行
- 18. 如何处理android输入系统知道输入事件不会导致anr?
- 19. 如何检测连接到系统的设备何时可以使用?
- 20. 设备到设备推送通知系统
- 21. 嵌入式设备系统
- 22. 嵌入式系统USB到Android设备
- 23. 如何知道哪些设备连接到我的网络(使用C#)?
- 24. 连接到蓝牙设备,你只知道
- 25. 连接到系统
- 26. 读取从/ dev/hidraw1设备连接到linux系统
- 27. 我如何知道Spark连接是高效的共分区输入连接?
- 28. 如何确定键合设备,使蓝牙RFCOMM Server知道谁连接到
- 29. 连接外部系统|如何设计系统
- 30. Android通知频道 - 从系统设置到应用设置的链接
您正在尝试使用哪种操作系统? – sadaf2605
更新问题 – developer
@Marko输入设备likw键盘,麦克风和鼠标等
输出设备如显示设备 – developer