Zip for UWP/WinRT
OpenBatch メソッド
使用例 

複数の操作を行うために zip ファイルを開きます。
構文
'宣言
 
Public Sub OpenBatch() 
public void OpenBatch()
解説

デフォルトでは、エントリが追加または削除されるときに、C1ZipFile が zip ファイルを自動的に開いたり閉じます。

これにより、ある種のウイルス対策ソフトウェアがインストールされているシステムや、比較的小さなエントリを大量に追加する状況で、遅延が発生する可能性があります。このような場合は、OpenBatch メソッドと CloseBatch メソッドを使用して、操作全体が終るまで zip ファイルを開いたままにします。

例外が発生した場合でも、CloseBatch メソッドが必ず呼び出されるように、finally 句を使用します。

使用例
以下のコードは、zip ファイルを開き、それにいくつかのエントリを追加し、ファイルを閉じます。
C1ZipFile zip = new C1ZipFile();
zip.Open(myzipfile);
try
{
zip.OpenBatch();
foreach (string fileName in Directory.GetFiles(path, "*.*"))
zip.Entries.Add(fileName);
}
finally
{
zip.CloseBatch();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

参照

関連項目

C1ZipFile クラス
C1ZipFile メンバ

Send Feedback