string[] files = System.IO.Directory.EnumerateFiles(directory, "*.*").ToArray();
using System.IO; string file = "C:Documentsfile.txt"; Path.GetDirectoryName(file);