示例#1
0
        public static void In()
        {
            Mark     Marks = new Mark();
            MarkInfo Mark1 = new MarkInfo("Madina", "Almanova", "Programming Principles 2", 99);
            MarkInfo Mark2 = new MarkInfo("Fox", "Mulder", "History", 67);
            MarkInfo Mark3 = new MarkInfo("Dana", "Scully", "Calculus 2", 86);

            Mark1.GetLetter();
            Mark2.GetLetter();
            Mark3.GetLetter();
            Marks.marks.Add(Mark1);
            Marks.marks.Add(Mark2);
            Marks.marks.Add(Mark3);

            FileStream    fs = new FileStream("mark.xml", FileMode.OpenOrCreate, FileAccess.ReadWrite);
            XmlSerializer xs = new XmlSerializer(typeof(Mark));

            xs.Serialize(fs, Marks);
            fs.Close();
        }
示例#2
0
文件: Mark.cs 项目: Almanova/PP2
 public Mark(MarkInfo markInfo)
 {
     marks = new List <MarkInfo>();
 }