CheckZipPassword Method (zipFileName, password)

DotNetZip

Ionic Zip Library v1.9.1.6 CheckZipPassword Method (zipFileName, password)
ReferenceIonic.ZipZipFileCheckZipPassword(String, String)
Verify the password on a zip file.
Declaration Syntax
C# Visual Basic Visual C++
public static bool CheckZipPassword(
	string zipFileName,
	string password
)
Public Shared Function CheckZipPassword ( _
	zipFileName As String, _
	password As String _
) As Boolean
public:
static bool CheckZipPassword(
	String^ zipFileName, 
	String^ password
)
Parameters
zipFileName (String)
The filename to of the zip file to fix.
password (String)
The password to check.
Return Value
a bool indicating whether the password matches.
Remarks

Keep in mind that passwords in zipfiles are applied to zip entries, not to the entire zip file. So testing a zipfile for a particular password doesn't work in the general case. On the other hand, it's often the case that a single password will be used on all entries in a zip file. This method works for that case.

There is no way to check a password without doing the decryption. So this code decrypts and extracts the given zipfile into Null

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)