开发者

Java: Get Device/Drive Name on Windows [duplicate]

开发者 https://www.devze.com 2023-03-08 15:39 出处:网络
This question already has answers here: 开发者_高级运维 Acquiring drive names (as opposed to drive letters) in Java
This question already has answers here: 开发者_高级运维 Acquiring drive names (as opposed to drive letters) in Java (3 answers) Closed 6 years ago.

I can get a list of drives plugged into a computer with File.listRoots(), but I only get the drive letter. How can I get the actual name of the drive (e.x. "Local Disk", "DVD RW Drive", etc.) as it's shown in Windows Explorer?


Use fileSystemView and the getSystemDisplayName()

0

精彩评论

暂无评论...
验证码 换一张
取 消