How can I detect if there is a floppy in a drive?

前端 未结 7 1862
孤独总比滥情好
孤独总比滥情好 2021-01-18 23:03

I tried to use DriveInfo.IsReady, but it returns false if an unformatted floppy is in the drive.

7条回答
  •  Happy的楠姐
    2021-01-18 23:18

    what about DriveNotFoundException?

    I don't have a floppy drive in the computer I'm on currently, so I can't test it. This exception is thrown when the drive is unavailable, which is a condition that I believe would be met when the floppy drive is empty.

提交回复
热议问题