private void bStart_Click(object sender, EventArgs e) { // 웹 강의 삭제 List <ListViewItem> lvil = new List <ListViewItem>(getLviArray()); for (int i = 0; i < lvil.Count;) { if (TimeParser.Get(lvil[i].SubItems[8].Text).te.Count == 0) { DelInIndex(lvil[i].SubItems[0].Text); lvil.RemoveAt(i); } else { i++; } } result.Clear(); AccessTable = new TimeTable(); stack.Clear(); if (subject_group.Count > 1) { subject_group.Sort((v1, v2) => v2.Count.CompareTo(v1.Count)); for (int i = 0; i < subject_group[0].Count; i++) { stack.Push(subject_group[0][i].index); AccessTable.Add(subject_group[0][i]); Iterate(1); stack.Pop(); AccessTable.Del(subject_group[0][i]); if (escape) { break; } } } result = result.OrderBy(a => Guid.NewGuid()).ToList(); if (result.Count > maxShowCount) { result.RemoveRange(maxShowCount, result.Count - maxShowCount); } StringBuilder builder = new StringBuilder(); foreach (string r in result) { builder.Append(r + '\n'); } System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"combinations.txt", builder.ToString()); escape = false; Program.m.ActivateTTListButton(); MessageBox.Show("생성완료!\n생성횟수: " + result.Count, Version.Name, MessageBoxButtons.OK, MessageBoxIcon.Information); }