I have this code:
DriveInfo dr = new DriveInfo(@"E:\");
if (dr.IsReady == false)
{
MessageBox.Show("Drive E: is not ready. Please insert a blank DVD medium.");
}
So, I insert a blank DVD in the drive and run the code. What am I missing?
Thanks a lot
DriveInfo.IsReadyon the blank DVD will return false.If you need to distinguish if a blank disc is there, you’ll need to use a different library. Here is a program that includes a interop wrapper around IMAPI2 (Window’s Image Mastering API): http://www.codeproject.com/KB/miscctrl/imapi2.aspx
Use the interop wrapper and call