我可以将 IList
转换为 ArrayList
吗?
如果是我该怎么办?
IList alls = RetrieveCourseStudents(cf);
ArrayList a = (ArrayList)alls;
对吗?
有错误:
Unable to cast object of type
最佳答案
正如评论中所建议的,您应该考虑改用通用集合
List<Student> students = RetrieveCourseStudents(cf).Cast<Student>().ToList()
关于c# - 如何将 Ilist 转换为 ArrayList?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8770577/