Beispiel #1
0
        public static void SR(ComplexNum cn, string Name)
        {
            FileStream    fs = new FileStream(Name, FileMode.OpenOrCreate, FileAccess.ReadWrite);
            XmlSerializer sr = new XmlSerializer(typeof(ComplexNum));

            sr.Serialize(fs, cn);
            fs.Close();
        }
Beispiel #2
0
        public static void DR(ComplexNum cn, string Name)
        {
            FileStream    fs = new FileStream(Name, FileMode.OpenOrCreate, FileAccess.ReadWrite);
            XmlSerializer dr = new XmlSerializer(typeof(ComplexNum));

            cn = dr.Deserialize(fs) as ComplexNum;
            Console.WriteLine(cn);
            fs.Close();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            string complex = Console.ReadLine();
            string Name    = Console.ReadLine();

            GetParts(complex);

            ComplexNum cn = new ComplexNum(real, imag);

            SR(cn, Name);
            DR(cn, Name);
        }