Пример #1
0
        public void SerializeObject(string filename, ObjectToSerialize objectToSerialize)
        {
            Stream          stream     = File.Open(filename, FileMode.Create);
            BinaryFormatter bFormatter = new BinaryFormatter();

            bFormatter.Serialize(stream, objectToSerialize);
        }
Пример #2
0
 public void SerializeObject(string filename, ObjectToSerialize objectToSerialize)
 {
     Stream stream = File.Open(filename, FileMode.Create);
     BinaryFormatter bFormatter = new BinaryFormatter();
     bFormatter.Serialize(stream, objectToSerialize);
 }