示例#1
0
文件: TestTime.cs 项目: lovgager/labs
 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);
 }
示例#2
0
文件: TestTime.cs 项目: lovgager/labs
 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);
 }