private static void WriteFilesRecursiveToZip(ZipArchive archive, IStorage storage, string basePath) { string searchPattern = basePath; string[] fileNames = storage.GetFileNames(searchPattern); foreach (string fileName in fileNames) { Stream fileStream = storage.OpenFile(basePath + "/" + fileName, StorageFileMode.Open, StorageFileAccess.Read); archive.AddEntry(fileName, fileStream); } string[] directrryNames = storage.GetDirectoryNames(searchPattern); foreach (string directoryName in directrryNames) { WriteFilesRecursiveToZip(archive, storage, basePath + "/" + directoryName); } }