Пример #1
0
        public static void SerializeBS(BusinessSystem bs, string fullPath)
        {
            BinaryFormatter formatter = new BinaryFormatter();

            using (FileStream fs = new FileStream(fullPath, FileMode.OpenOrCreate))
            {
                formatter.Serialize(fs, bs);
            }
        }
Пример #2
0
        public static BusinessSystem DeserializeBS(string fullPath)
        {
            BinaryFormatter formatter      = new BinaryFormatter();
            BusinessSystem  deserializedBS = new BusinessSystem();

            using (FileStream fs = new FileStream(fullPath, FileMode.OpenOrCreate))
            {
                deserializedBS = (BusinessSystem)formatter.Deserialize(fs);
            }

            return(deserializedBS);
        }