1. List<string> strL = new List<string>();
var tt = strL.Where(x => x == "OK").ToList().Count; //List中包含“OK”的总数.
2. List<User> UsersList = new List<User>();
UsersList.Add(new User() { Name = "zzy", ID = 10101 });
UsersList.Add(new User() { Name = "carl", ID = 10102 });
UsersList.Add(new User() { Name = "Tim", ID = 10103 });
List<string> nameList = (from user in UsersList
where user.Name == "zzy" && user.ID == 10101
select user.Name).ToList<string>();
//或
List<string> nameList = UsersList
.Where(user => user.Name == "zzy" && user.ID == 10101)
.Select(user => user.Name)
.ToList();
//User 集合
List<User> nameList2 = UsersList.Where(x => x.Name == "zzy" && x.ID == 10101).ToList();