Drive Type

image_pdfimage_print
   
  

using System;
using System.IO;

class MainClass {
    static void Main(string[] args) {
        FileInfo file = new FileInfo("c:a.txt");

        // Display drive information.
        DriveInfo drv = new DriveInfo(file.FullName);

        Console.Write("Drive: ");
        Console.WriteLine(drv.Name);

        if (drv.IsReady) {
            Console.Write("Drive type: ");
            Console.WriteLine(drv.DriveType.ToString());
        }
    }
}

   
     


This entry was posted in File Stream. Bookmark the permalink.