/// <summary> /// 关闭应用 /// </summary> private void Close() { if (_wb != null) { COMHelper.ReleaseObject(_wb); } if (_isNewApp && _appCreatedTimeBegin != null && _appCreatedTimeEnd != null) { COMHelper.KillProcessByNameAndStartTime(Aim.Component.ThirdpartySupport.Application.MS_OFFICE_EXCEL_PROCESS_NAME, _appCreatedTimeBegin.Value, _appCreatedTimeEnd.Value); } GC.Collect(); GC.WaitForPendingFinalizers(); }