Example #1
0
        public static void Try2DeSerializeBit()
        {
            Class4SerializeBit obj2ser = null;

            using (FileStream fs = new FileStream("BinState.dat", FileMode.Open, FileAccess.Read))
            {
                BinaryFormatter bf = new BinaryFormatter();

                obj2ser = bf.Deserialize(fs) as Class4SerializeBit;
            }
        }
Example #2
0
        public static void Try2SerializeBit()
        {
            Class4SerializeBit obj2ser = new Class4SerializeBit()
            {
                Number = 7, Login = "******", Password = "******"
            };

            using (FileStream fs = new FileStream("BinState.dat", FileMode.OpenOrCreate, FileAccess.Write))
            {
                BinaryFormatter bf = new BinaryFormatter();

                bf.Serialize(fs, obj2ser);
            }
        }