private static void CreateDirectoryIfNotExists(string dir) { if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } }