Exemple #1
0
 public MethodResult Save()
 {
     MethodResult methodResult = new MethodResult();
     System.IO.FileStream fileStream = new System.IO.FileStream(this.FullPath, System.IO.FileMode.Create);
     byte[] bytes = this.m_MemoryStream.ToArray();
     fileStream.Write(bytes, 0, bytes.Length);
     fileStream.Close();
     methodResult.Success = true;
     return methodResult;
 }
Exemple #2
0
 public MethodResult Load()
 {
     MethodResult methodResult = new MethodResult();
     this.m_MemoryStream = new System.IO.MemoryStream();
     if (System.IO.File.Exists(this.m_FullPath) == true)
     {
         System.IO.FileStream fileStream = System.IO.File.OpenRead(this.m_FullPath);
         FileHelper.CopyStream(fileStream, MemoryStream);
         fileStream.Close();
         methodResult.Success = true;
     }
     else
     {
         methodResult.Message = FileNotFoundMessage;
         methodResult.Success = false;
     }
     return methodResult;
 }