Drive Type : Drive : File Stream C# Source Code


Custom Search

C# Source Code » File Stream » Drive »

 

Drive Type








    
 

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());
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo File Stream
» Drive