Hi, I have a CDROM drive which is ready (I think so, because I can open a disc using it without having any problem), but I tried getting its volume label and there was an exception saying "The device is not ready":
Here is my code:
DriveInfo cd = new DriveInfo("F"); MessageBox.Show(cd.VolumeLabel)
How can I get its volume label?
Your help would be highly appreciated! Thanks!
Check for cd.IsReady flag,if it is false the device is not actually ready and you can put the code to sleep and try again.If it is always false then there is a problem with the Drive.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)