How can I get list of all drives but also get the corresponding drive type (removable,local disk, or cd-rom,dvd-rom… etc)?

前端 未结 7 1074
猫巷女王i
猫巷女王i 2020-12-01 14:42

How can I get list all drives but also get the corresponding drive type (removable,local disk, or cd-rom,dvd-rom... etc)?

7条回答
  •  情歌与酒
    2020-12-01 14:46

    Assuming it's windows, use File.listRoots() to get all roots. Then use FileSystemView to check whether it's floppy disk or a drive. Other than that I have no idea.

提交回复
热议问题