| C1.UWP.Zip Assembly > C1.C1Zip Namespace > C1ZipEntryCollection Class > AddAsync Method : AddAsync(StorageFile) Method |
'Declaration 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 )
This method is available only in the WinRT version.
This method is asynchronous, and should normally be used within 'await' statements as shown in the example below.
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); } }