方法一 List list = new List ();list.Add(1);list.Add(1);list.Add(2);list.Add(2);list.Add(3);list.Add(3);list = list.Distinct().ToList();//list里只有1,2,3 方法二 ListlistBuildCenterInformationCode = new List ();
HashSet<string> hs = new HashSet<string>(listBuildCenterInformationCode);
listBuildCenterInformationCode = hs.ToList();