Zip for UWP/WinRT
AddAsync(StorageFile) メソッド
使用例 

zip ファイルに追加するファイル。
現在の zip ファイルにファイルを追加します。
構文
'宣言
 
Public Overloads Function AddAsync( _
   ByVal file As Windows.Storage.StorageFile _
) As System.Threading.Tasks.Task
public System.Threading.Tasks.Task AddAsync( 
   Windows.Storage.StorageFile file
)

パラメータ

file
zip ファイルに追加するファイル。
解説

このメソッドは WinRT バージョンでのみ実行できます。

このメソッドは非同期です。通常は、以下の例で示すように 'await' 文内で使用する必要があります。

使用例
次のコードは、ユーザーにファイル名の入力を要求した後、それらのファイルを現在の zip アーカイブに追加します。
using Windows.Storage.Pickers;
var picker = new FileOpenPicker();
picker.ViewMode = PickerViewMode.List;
picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
picker.FileTypeFilter.Add("*");
var files = await picker.PickMultipleFilesAsync();
if (files != null)
{
foreach (var f in files)
{
await _zip.Entries.AddAsync(f);
}
}
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

参照

関連項目

C1ZipEntryCollection クラス
C1ZipEntryCollection メンバ
オーバーロード一覧

Send Feedback