Click here to Skip to main content
15,888,218 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
string[] drives = Directory.GetLogicalDrives();

here i want get the only cdrom/dvd rom drives

how can i find out that
Posted

This post discusses about the same thing: http://www.eggheadcafe.com/software/aspnet/30307033/detecting-cd-drive-letter-in-c.aspx[^]

Hope it helps!
 
Share this answer
 
I know this is an old question and you've long since found your solution, but this may help someone else who's looking...

C#
foreach (System.IO.DriveInfo drive in System.IO.DriveInfo.GetDrives()) {
	if (drive.DriveType == DriveType.CDRom) {
		// Your code here

	}
}
 
Share this answer
 
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900