Created
July 19, 2015 01:08
-
-
Save Fhernd/3b86602e5590dc42a5bf to your computer and use it in GitHub Desktop.
Uso de la clase DriveInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OrtizOL - xCSw - http://ortizol.blogspot.com | |
using System; | |
using System.IO; | |
namespace Receta.CSharp.R0516 | |
{ | |
public class UsoDriveInfo | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine (); | |
// Obtención de las unidades actuales en el sistema: | |
DriveInfo[] unidades = DriveInfo.GetDrives(); | |
// Enlistamiento: | |
foreach (DriveInfo unidad in unidades) | |
{ | |
if (unidad.IsReady == true) | |
{ | |
Console.WriteLine("Letra unidad: {0}", unidad.Name); | |
Console.WriteLine("Formato unidad: {0}", unidad.DriveFormat); | |
Console.WriteLine("Nombre volumen: {0}", unidad.VolumeLabel); | |
Console.WriteLine("Espacio libre: {0}", unidad.AvailableFreeSpace.ToString()); | |
Console.WriteLine (); | |
} | |
} | |
Console.WriteLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment