我有个函数里用了这么一句:
System.Collections.Generic.List<T>.Enumerator<MobileMessage> enumerator1 = this.mList.GetEnumerator ();
编译时说“找不到类型或命名空间名称“T”(是否缺少using指令或程序集引用?)”
第二个错误说:非泛型 类型“System.Collections.Generic.List<T>.Enumerator”不能与类型参数一起使用但我找了,发现System.Collections.Generic里是有list<T>的哦,这个问题怎么解决了?在线等,多谢各位高手帮忙了

解决方案 »

  1.   

    泛型用错了吧..
    System.Collections.Generic.List<T>.Enumerator<MobileMessage>
    改成
    System.Collections.Generic.List<T>.Enumerator
      

  2.   

    LZ看一下泛型.是.net2.0独有的.T是指代一个类型,比如List<int>,List<string>
    List<一个类名>
      

  3.   

    System.Collections.Generic.List<T>.Enumerator<MobileMessage>这是啥东西?哪里抄来的代码?System.Collections.Generic.IEnumerator<MobileMessage>
      

  4.   

    啊?...看这里了,应该这样

    using System.Collections.Generic;然后
    IEnumerator<MobileMessage>  mm=.....
      

  5.   

    System.Collections.Generic.List<MobileMessage>.Enumerator enumerator1 = this.mList.GetEnumerator ();应该解决