471,337 Members | 907 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Question about CD!

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
Dec 8 '05 #1
1 963
Mel
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/lib...driveinfo.aspx

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

Try it. It may be useful for you

Good Luck

Dec 8 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Mohammed Mazid | last post: by
3 posts views Thread by Stevey | last post: by
10 posts views Thread by glenn | last post: by
53 posts views Thread by Jeff | last post: by
56 posts views Thread by spibou | last post: by
2 posts views Thread by Allan Ebdrup | last post: by
3 posts views Thread by Zhang Weiwu | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.