C# 错误 CS0029: 无法将类型“System.Collections.Generic.List<System.IO.FileInfo>”隐式转换为“System.Collections.Generic.List<string>”
这个错误是由于无法将类型'System.Collections.Generic.List<System.IO.FileInfo>' 隐式转换为'System.Collections.Generic.List
原因是 GetFiles() 方法返回的是一个 FileInfo 类型的列表,而你将其放入了一个 List
要解决这个问题,你可以在 Select() 方法中将 FileInfo 对象转换为文件路径字符串,例如:
List
原文地址: https://www.cveoy.top/t/topic/fPk 著作权归作者所有。请勿转载和采集!