public void Newnote() { FileStream NewText = File.Create(@"h:\notebook.txt"); Console.WriteLine("笔本已新建完成"); NewText.Close(); Console.WriteLine("请输入笔记:"); String text = Console.ReadLine(); Console.WriteLine("是否要保存笔记(y/n)"); string answer = Console.ReadLine(); if (answer.Equals("y")) { SaveType t = new SaveType(text); Save(t); } else { } }
public void Newclass() { Console.WriteLine("请输入新的科目"); String type = Console.ReadLine(); StreamWriter sw = new StreamWriter(@"h:\notebook.txt"); sw.WriteLine(type); Console.WriteLine("该类型已保存成功"); sw.Close(); Console.WriteLine("是否要保存笔记(y/n)"); string answer = Console.ReadLine(); if (answer.Equals("y")) { //SaveNote sn = new SaveNote(); //sn.Savenote(type); SaveType t = new SaveType(type); Save(t); } else { } }