示例#1
0
 public void LoeadFromFile(ref Central central, String f)
 {
     using (Stream stream = File.Open(f, FileMode.Open))
     {
         var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
         central = (Central)binaryFormatter.Deserialize(stream);
     }
 }
示例#2
0
 public void SaveToFile(String f, Central central)
 {
     using (Stream stream = File.Open(f, FileMode.Create))
     {
         var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
         binaryFormatter.Serialize(stream, central);
     }
 }