Zip for UWP/WinRT
C1ZipFile クラス
メンバ  使用例 

zip ファイルの作成、オープン、管理に使用されます。
オブジェクト モデル
C1ZipFile クラス
構文
'宣言
 
Public Class C1ZipFile 
public class C1ZipFile 
解説

C1Zip ファイルオブジェクトをディスク内の zip ファイルに関連付けるには、Open(string) メソッドまたは Create(string) メソッドを使用します。次に、zip ファイル内の個々のエントリを追加、削除、取得、または調査するには、Entries プロパティを使用します。

C1ZipFile は、標準の zip ファイルでのみ使用できます。このコンポーネントは、gzip、zip2、tar、rar などの他の似た形式をサポートしません。

標準の zip ファイルは、各エントリのサイズに制限を課します。これを使用して、4ギガバイト(uint.MaxValue)を超えるファイルを圧縮することはできません。

使用例
次のコードは、sources.zip という名前の zip ファイルを作成し、"cs" という拡張子を持つすべてのファイルをその zip ファイルに追加します。
// zip ファイルと圧縮するファイルのパスを取得します
string path = Application.ExecutablePath;
int pos = path.IndexOf(@"\bin");
path = path.Substring(0, pos + 1);

// zip ファイルを作成します
C1ZipFile zip = new C1ZipFile();
zip.Create(path + "source.zip");

// cs 拡張子を持つすべてのファイルを zip ファイルに追加します
foreach (string fileName in Directory.GetFiles(path, "*.cs"))
zip.Entries.Add(fileName);

// 結果を表示します
foreach (C1ZipEntry ze in zip.Entries)
{
Console.WriteLine("{0} {1:#,##0} {2:#,##0}",
ze.FileName, ze.SizeUncompressed, ze.SizeCompressed);
}
継承階層

System.Object
   C1.C1Zip.C1ZipFile

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 メンバ
C1.C1Zip 名前空間

Send Feedback