Click here to Skip to main content
15,904,287 members
Articles / Programming Languages / C#

How to Detect CD-ROM is loaded in the CD-ROM drive

Rate me:
Please Sign up or sign in to vote.
5.00/5 (5 votes)
5 Dec 2011CPOL 8K   2  
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...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United States United States
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.

Comments and Discussions