FileStream_exists.htm

using System;
using System.IO;
//csc directoryinfo_exists.cs
namespace dir_files
{
public class dir_create
{

public static void procces( string s )
{

string path = s;
try
{
// Determine whether the directory exists.
if (Directory.Exists(path))
{ Console.WriteLine("That path exists already."); return; } //end of if
//else create directory
DirectoryInfo root = Directory.CreateDirectory(path);
Console.WriteLine("The directory was created successfully at {0}.", Directory.GetCreationTime(path));

}
catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
finally {}
}

}//end of the class

class Test
{
public static void Main()
{
do
{
Console.Write(" Enter complete path :");
string str =Console.ReadLine();
if(str !=""){ dir_create.procces(str);}
else return;
} while(true);
}
}
}