.net2005中报错:“使用泛型类型System.Collections.Generic.Icomparer <T> 需要一个类型参数 ”
解决方法:using了System.Collections.Generic,造成class ListViewItemComparer : IComparer这一行中的IComparer被认为是System.Collections.Generic.Icomparer <T> ,所以要实现int Compare (T x,T y),或者把using中改为System.Collections
System.Collections.Generic:泛型
System.Collections :非泛型
本文介绍了解决 .NET2005 中出现的“使用泛型类型 System.Collections.Generic.IComparer<T> 需要一个类型参数”的错误方法。主要问题在于混淆了泛型与非泛型的 IComparer 接口。通过更改 using 指令或实现具体的 Compare 方法可以解决此问题。
671

被折叠的 条评论
为什么被折叠?



