/// <summary> /// 将序列化文件中字段信息赋值到类UploadCheckPoint中的字段 /// </summary> /// <param name="temp"></param> public void Assign(UploadCheckPoint temp) { this.BucketName = temp.BucketName; this.ObjectKey = temp.ObjectKey; this.UploadFile = temp.UploadFile; this.UploadId = temp.UploadId; this.Md5 = temp.Md5; this.FileStatus = temp.FileStatus; this.UploadParts = temp.UploadParts; this.PartEtags = temp.PartEtags; }
/// <summary> /// 加载序列化文件CheckPointFile /// </summary> public void Load(string checkPointFile) { UploadCheckPoint temp = null; XmlSerializer serializer = new XmlSerializer(this.GetType()); using (XmlTextReader fs = new XmlTextReader(checkPointFile)) { temp = (UploadCheckPoint)serializer.Deserialize(fs); } Assign(temp); }