Beispiel #1
0
        public static void SerializeSoap()
        {
            ClassToSerialize c          = new ClassToSerialize();
            FileStream       fileStream = new FileStream("C:\\DDD\\temp\\temp.xml", FileMode.Create);
            SoapFormatter    b          = new SoapFormatter();

            b.Serialize(fileStream, c);
            fileStream.Close();
        }
Beispiel #2
0
        public static void SerializeNow()
        {
            ClassToSerialize c          = new ClassToSerialize();
            FileStream       fileStream = new FileStream("C:\\DDD\\temp\\temp.zph", FileMode.Create);
            BinaryFormatter  b          = new BinaryFormatter();

            b.Serialize(fileStream, c);
            fileStream.Close();
        }
Beispiel #3
0
        public static void DeSerializeSoap()
        {
            ClassToSerialize c = new ClassToSerialize();

            c.Sex = "FFFF";
            FileStream    fileStream = new FileStream("C:\\DDD\\temp\\temp.xml", FileMode.Open, FileAccess.Read, FileShare.Read);
            SoapFormatter b          = new SoapFormatter();

            c = b.Deserialize(fileStream) as ClassToSerialize;
            Console.Write(c.name);
            Console.Write(c.Sex);
            fileStream.Close();
        }