摘要:
string path = Application.StartupPath + "\\" + "timeLenth.txt"; FileStream fs1 = new FileStream(path, FileMode.Create, FileAccess.Write);//搜索创建写入文件 StreamWriter sw = new StreamWriter(fs1); sw.Write("Content no other line"); sw.Write(" ... 阅读全文
摘要:
如T为 classstudent(){ string name; int age;}按age大小排序写法一:students.Sort((student1,student2)=>student1.age-student2.age);写法二:void SortStudents(List students) { students.Sort(Comparison); } private int Comparison(student student1, student student2) { return student1.age - student2.age; } 阅读全文