Need help to find the VID/PID of the usb drive connected to the system through java code

后端 未结 2 374
执笔经年
执笔经年 2020-12-11 03:09

I need to find the vendor Id, Product Id of the usb drive connected to the system, through java code. Any suggestions...

相关标签:
2条回答
  • 2020-12-11 03:12

    I have never interfaced with USB in Java before, but have a look at JSR-80 (javax.usb) API. IBM DeveloperWorks have a tutorial (which can be useful).

    0 讨论(0)
  • 2020-12-11 03:29

    If you need windows only use WMI. I do not think that cross-platform pure java solution exists at all. You have several ways to connect to WMI. Check out Jawin, Jintegra, Jinterop. All these libraries support WMI. You can also create WMI script using VBScript or JScript and run as an external command line tool from Java using cscript command.

    0 讨论(0)
提交回复
热议问题