Foydalanish misoli:
using System;
using System.IO;
class Test
{
public static void Main()
{
DriveInfo[] allDrives = DriveInfo.GetDrives();
foreach (DriveInfo d in allDrives)
{
Console.WriteLine(" {0} disk", d.Name);
Console.WriteLine(" Disk turi: {0}", d.DriveType);
if (d.IsReady == true)
{
Console.WriteLine(" Volume label: {0}", d.VolumeLabel);
Console.WriteLine(" Fayl tizimi: {0}", d.DriveFormat);
Console.WriteLine(" Mavjud foydalanuvchiga bo'sh joy: {0, 15} bytes",
d.AvailableFreeSpace);
Console.WriteLine(" Umumiy bo'sh joy: {0, 15} bytes",
d.TotalFreeSpace);
Console.WriteLine(" Drayvning umumiy hajmi: {0, 15} bytes \n", d.TotalSize);
}
}
Console.ReadKey();
}
}
Natijasi:
Do'stlaringiz bilan baham: |