public static bool Load(string filename, ref TestTime obj) { try { BinaryFormatter bf = new BinaryFormatter(); FileStream fs = new FileStream(filename, FileMode.Create); obj = bf.Deserialize(fs) as TestTime; } catch (Exception) { return(false); } return(true); }
public static bool Save(string filename, TestTime obj) { try { BinaryFormatter bf = new BinaryFormatter(); FileStream fs = new FileStream(filename, FileMode.Create); bf.Serialize(fs, obj); } catch (Exception) { return(false); } return(true); }