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