示例#1
0
文件: Program.cs 项目: Meiramova/PP2
        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();
        }
示例#2
0
文件: Program.cs 项目: Meiramova/PP2
        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();
        }
示例#3
0
文件: Program.cs 项目: Meiramova/PP2
        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);
        }