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'
You could use the DirectoryInfo constructor which allows you to pass a string which represents the path:
Directory.Add(new DirectoryInfo("C:\\test"));
精彩评论