Question Test if it´s an valid archive

muffivb

New member
Joined
Sep 1, 2011
Messages
1
Programming Experience
3-5
I´m using SevenZipSharp (with 7z.dll). Now I´m trying to write a little program that will test the files of a directory if there is a file which could be extracted by 7z.dll.

First try was like this:
VB.NET:
Dim file As SevenZipExtractor = New SevenZipExtractor(IO.File.OpenRead(path))

At the first non-valid archive file, this line throws me a "The stream is invalid or no corresponding signature was found.". Of course I can use Try...End Try, but this seems to be slow. Is there any better solution to test if the file is valid for 7z.dll?

Thanks!
 
There doesn't appear to be any preliminary detection available. File extension should be primary identification for valid file types.
 
Back
Top