public void Load() { DirectoryInfo di = new DirectoryInfo(UserFilePath); UserSet tmp; foreach (FileInfo fi in di.GetFiles()) { tmp = UserSet.Read(fi.Name); if (AllUser.FindIndex( user => user.UserName == tmp.UserName) < 0) { AllUser.Add(tmp); } } if (AllUser.Count <= 0) { tmp = new UserSet(); tmp.Save(); AllUser.Add(tmp); } }