Retrieve a list of disk drives using C#
This code retrieves a list of drives, stores it into an array of strings, and then loops through it to display the drives.
|
On Thursday, October 18th 2007 at 08:09 PM By Andrew Pociu (View Profile)
    (Rated 4 with 3 votes) |
Contextual Ads
More C# Resources
Advertisement
// Store the list of drives into an array of string
string[] DriveList = Environment.GetLogicalDrives();
// Loop through the array
for (int i = 0; i < DriveList.Length; i++)
{
// Show each drive
MessageBox.Show(DriveList[i]);
}
|
Digg It!
Del.icio.us
Reddit
StumbleIt
Newsvine
Furl
BlinkList
|
|
Rate this code snippet
Current Comments
|
Related Source Code
There is no related code.
Related Tutorials
There are no related tutorials.
C# Job Search
|