public static void Serialize(AsmInfo asm, string path, object obj) { path = asm.InAppDir(path); using (Stream stream = File.OpenWrite(path)) { BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(stream, obj); } }
public static object Deserialize(AsmInfo asm, string path) { path = asm.InAppDir(path); object obj = null; using (Stream stream = File.OpenRead(path)) { BinaryFormatter formatter = new BinaryFormatter(); obj = formatter.Deserialize(stream); } return obj; }