Question about CD!

  • Thread starter Thread starter Mihai Velicu
  • Start date Start date
M

Mihai Velicu

If I read all the drives from my computer with
System.IO.Directory.GetLogicalDrives()

what property shows me which one is the hard-drive and which one is the CD
drive?

Thank , Mihai
 
Hi, in .NET Framework version 2.0, there is class call DriveInfo, you
can use this class to determine what drives are available, and what
type of drives they are. You can also query to determine the capacity
and available free space on the drive.
They have property called "DriveInfo.DriveType", The DriveType property
indicates whether a drive is any of: CDRom, Fixed, Unknown, Network,
NoRootDirectory, Ram, Removable, or Unknown. Values are listed in the
DriveType enumeration.

check this out:
http://msdn2.microsoft.com/en-us/library/system.io.driveinfo.aspx

Here is an example for combining use of GetLogcialDrive and DriveType.
http://www.codeproject.com/cs/combobox/drivecombobox.asp

Try it. It may be useful for you

Good Luck
 
Back
Top