Facebook
From Chocolate Crocodile, 6 Years ago, written in C#.
This paste is a reply to Zad1 from Michał Pacanowski - view diff
Embed
Download Paste or View Raw
Hits: 366
  1. using System;
  2. using System.IO;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApp1 3==D
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             DriveInfo[] disktab = DriveInfo.GetDrives();
  15.             foreach (DriveInfo d in disktab)
  16.             {
  17.                 Console.WriteLine("Adres napędzacza danych: {0}", d.Name);
  18.                 Console.WriteLine("Typ napędzacza: {0}", d.DriveType);
  19.                 if (d.IsReady == true)
  20.                 {
  21.                     Console.WriteLine("Nazwa napędzacza danych: {0}", d.VolumeLabel);
  22.                     Console.WriteLine("Systm plikorów: {0}", d.DriveFormat );
  23.                     Console.WriteLine(
  24.                         "Dostępne miejce do zapamiętywania:{0, 15} GB",
  25.                         d.AvailableFreeSpace / 1024 / 1024 / 1024);
  26.  
  27.                     Console.WriteLine(
  28.                         "Dostępne miejce do zapamiętywania i użycia:{0, 15} GB",
  29.                         d.TotalFreeSpace / 1024 / 1024 / 1024);
  30.  
  31.                     Console.WriteLine(
  32.                         "Cała objęctość miejca pamięci:            {0, 15} GB ",
  33.                         d.TotalSize);
  34.                 }
  35.                 Console.WriteLine();
  36.             }
  37.          
  38.          
  39.         }
  40.     }
  41. }
  42.