Get Directory information from FileInfo : File Info : File Stream C# Source Code


Custom Search

C# Source Code » File Stream » File Info »

 

Get Directory information from FileInfo








    



using System;
using System.IO;

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

        // Display directory information.
        DirectoryInfo dir = file.Directory;

        Console.WriteLine("Checking directory: " + dir.Name);
        Console.WriteLine("In directory: " + dir.Parent.Name);
        Console.Write("Directory exists: ");
        Console.WriteLine(dir.Exists.ToString());

    }
}
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo File Stream
» File Info