Reputation: 3013
how to add new directory to List
public static List<DirectoryInfo> Directory = new List<DirectoryInfo>();
Directory.Add("C:\\test"); // error 'string' to 'System.IO.DirectoryInfo'
Upvotes: 2
Views: 1020
Reputation: 1039588
You could use the DirectoryInfo constructor which allows you to pass a string which represents the path:
Directory.Add(new DirectoryInfo("C:\\test"));
Upvotes: 4