private void UpdateFile() { isUpdating = true; UpdateInfo.LoadingUpdateFileList += new LoadingUpdateFileListHandle(UpdateInfo_LoadingUpdateFileList); //获取升级文件列表 List <UpdateInfo> lstUpdateFileList = UpdateInfo.LoadUpdateFileList(); totalFileNum = lstUpdateFileList.Count; currentIndex = 0; foreach (UpdateInfo updateInfo in lstUpdateFileList) { try { updateInfo.UpdateProcessing += new UpdateProcessingHandle(updateInfo_UpdateProcessing); updateInfo.FileUpdate += new FileUpdateHandle(updateInfo_FileUpdate); updateInfo.Update(); } catch (Exception error) { //记录异常 add by wangzhi 2013-06-19 Classes.Logger.Write(updateInfo.Name, error); } finally { currentIndex++; } } isUpdating = false; if (UpdateComplated != null) { UpdateComplated(); } Classes.Logger.Write("升级结束"); }