Check the Existance of a Directory : Directory : File Stream C# Source Code


Custom Search

C# Source Code » File Stream » Directory »

 

Check the Existance of a Directory








    



using System;
using System.IO;

class MainClass {
    static void Main(string[] args) {
        foreach (string arg in args) {
            Console.Write(arg);

            if (Directory.Exists(arg)) {
                Console.WriteLine(" is a  directory");
            } else if (File.Exists(arg)) {
                Console.WriteLine(" is a  file");
            } else {
                Console.WriteLine(" does not exist");
            }
        }
    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo File Stream
» Directory