本帖最后由 lr 于 2014-04-30 11:08:37 编辑

解决方案 »

  1.   

    IPList.OrderBy(x=>x.myDateTime);IPList.OrderByDescending(x=>x.myDateTime);
      

  2.   

    list = IPList.OrderByDescending(x=>x.myDateTime).ToList()
    或者继承接口IComparer,自己写排序
      

  3.   


    你有认真读过这个函数的介绍吗?List本身不变,但返回一个排序后的List,参照3#版主的。
      

  4.   

    继承接口
    public class ipData:IComparer
    {
        public DateTime myDateTime{ set; get; }
        public string theIP{ set; get; }        
    }
      

  5.   

    我觉得 楼上 好像都复杂了点吧! List 类中 有个属性,可以自动排序的,比如 List<string> str =new List<string>();str.Sort("Item");
    Item 就是你需要排序的字段,默认是升序好像。希望能帮到你。