SevenZip/SevenZipExtractor.cs
/// <summary>
///   Performs the archive integrity test.
/// </summary>
/// <returns>True is the archive is ok; otherwise, false.</returns>
Performs the archive integrity test.
Performs the archive integrity test .
public bool Check()
        {
            DisposedCheck();
            try
            {
                InitArchiveFileData(false);
                IInStream archiveStream = GetArchiveStream(true);
                ArchiveOpenCallback openCallback = GetArchiveOpenCallback();
                if (!OpenArchive(archiveStream, openCallback))
                {
                    return false;
                }
                using (ArchiveExtractCallback aec = GetArchiveExtractCallback("", (int) _filesCount, null))
                {
                    try
                    {
                        CheckedExecute(
                            _archive.Extract(null, UInt32.MaxValue, 1, aec),
                            SevenZipExtractionFailedException.DEFAULT_MESSAGE, aec);
                    }
                    finally
                    {
                        FreeArchiveExtractCallback(aec);
                    }
                }
            }
            catch (Exception)
            {
                return false;
            }
            finally
            {
                if (_archive != null)
                {
                    _archive.Close();
                }
                ((InStreamWrapper) _archiveStream).Dispose();
                _archiveStream = null;
                _opened = false;
            }
            return true;
        }
public bool Check ( ) { DisposedCheck ( ) ; try { InitArchiveFileData ( false ) ; IInStream archiveStream = GetArchiveStream ( true ) ; ArchiveOpenCallback openCallback = GetArchiveOpenCallback ( ) ; if ( ! OpenArchive ( archiveStream , openCallback ) ) { return false ; } using ( ArchiveExtractCallback aec = GetArchiveExtractCallback ( " " , ( int ) _filesCount , null ) ) { try { CheckedExecute ( _archive . Extract ( null , UInt32 . MaxValue , 1 , aec ) , SevenZipExtractionFailedException . DEFAULT_MESSAGE , aec ) ; } finally { FreeArchiveExtractCallback ( aec ) ; } } } catch ( Exception ) { return false ; } finally { if ( _archive != null ) { _archive . Close ( ) ; } ( ( InStreamWrapper ) _archiveStream ) . Dispose ( ) ; _archiveStream = null ; _opened = false ; } return true ; }
Performs the archive integrity test.
Performs the archive integrity test .
True is the archive is ok; otherwise, false.
True is the archive is ok ; otherwise false .