DriveInfo[] drives = DriveInfo.GetDrives();
foreach (DriveInfo drive in drives)
{ string label = drive.IsReady ? String.Format( " - {0}", drive.VolumeLabel ) : null; Console.WriteLine( "{0} - {1}{2}", drive.Name, drive.DriveType, label );}
Output şuna benzer bir şey olacak:
C:\ – Fixed – WinXPD:\ – Fixed – DataE:\ – CDRomF:\ – CDRomG:\ – RemovableH:\ – RemovableT:\ – Fixed – TempU:\ – Fixed – BackupsV:\ – Fixed – VMsW:\ – Fixed – Vista
Hiç yorum yok:
Yorum Gönder