using System.IO;

Does directory exist?

(Note paths can include a filename if you wish)


	if (!Directory.Exists(Path.GetDirectoryName(MyFileName)))
		Directory.CreateDirectory(Path.GetDirectoryName(MyFileName));
	//or
	String path;
	path = "C:\\Atest\\";				//		'\\'='\'
	if (!Directory.Exists(path))
	//or
	if (!Directory.Exists("C:\\Atest\\"))	//		'\\'='\'

Create Directory

(Note paths can include a filename if you wish)


	Directory.CreateDirectory(Path.GetDirectoryName(MyFileName));
	//or
	String path;
	path = "C:\\Atest\\";				//		'\\'='\'
	Directory.CreateDirectory(path);
	//or
	Directory.CreateDirectory("C:\\Atest\\");	//		'\\'='\'

Get Directory From File Path


	sTemp = Path.GetDirectoryName(MyFilename)