Exemplo n.º 1
0
        private static void F1()
        {
            Marking       s  = new Marking();
            FileStream    fs = new FileStream("student.txt", FileMode.Create, FileAccess.Write);
            XmlSerializer xs = new XmlSerializer(typeof(Marking));

            xs.Serialize(fs, s);
            fs.Close();
        }
Exemplo n.º 2
0
        private static void F2()

        {
            FileStream    fs = new FileStream("student.txt", FileMode.Open, FileAccess.Read);
            XmlSerializer xs = new XmlSerializer(typeof(Marking));
            Marking       t  = xs.Deserialize(fs) as Marking;

            fs.Close();
        }