コード例 #1
0
ファイル: DataHelper.cs プロジェクト: elluvium/Foxy
        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
ファイル: DataHelper.cs プロジェクト: elluvium/Foxy
        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);
        }