Hi, I'm new in C# programing. I'm using Visual Studio 2008. I wont to make an application which show me catalogue structure on CD/DVD disk. I know how to view folder and files in define path, "D:\" for example. But whot if some one have CD drive on different letter. I wont to do something like this: I put CD into drive and program automatically show me all folders and files on CD. Meybe someone heve some example how to do this or any sources where I can read about that?
thank you for any help :-)

System.IO.DriveInfo[] drives = System.IO.DriveInfo.GetDrives();

foreach (System.IO.DriveInfo drive in drives)
{
if (drive.DriveType == System.IO.DriveType.CDRom)
Console.WriteLine(drive.Name);
}

Floppies will appear as DriveType.Removable, same as USB drives.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.