Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Create a Password Protected Zip
Demonstrates how to create a Zip with password protection. // Visual C++ Example Source Code
// to create a Password-Protected Zip file
//
#include "stdafx.h"
#include "CkZip.h"
#include "CkZipEntry.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// Unlock the Zip product.
// This only needs to be done once when the first CkZip object
// is instantiated.
CkZip zip;
zip.UnlockComponent("unlockCode");
// Create a new Zip and append files and directories recursively.
zip.NewZip("myZip.zip");
zip.AppendFiles("./Tree/*",true,0);
// Set the options to Zip with standard Zip password protection.
// This is the same password protection used by programs
// such as WinZip.
zip.put_PasswordProtect(true);
zip.SetPassword("myPassword");
zip.WriteZipAndClose(0);
return 0;
}
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.