开发者

Add dir to List DirectoryInfo

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"));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜