Or you could just do the following without using
System.Management
:
foreach (var driveInfo in DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.CDRom))
{
if (driveInfo.IsReady)
Console.WriteLine("CD is ready in drive: " + driveInfo.Name);
else
Console.WriteLine("CD is not ready in drive: " + driveInfo.Name);
}
Since I've begun my profession as a software developer, I've learned one important fact - change is inevitable. Requirements change, code changes, and life changes.
So..If you're not moving forward, you're moving backwards.