在1.zip中增加一张新图片
//把上面这句改成如下就成了压缩文件
//StorageFile zip = await KnownFolders.PicturesLibrary.CreateFileAsync(jpg.DisplayName+".zip",CreationCollisionOption.ReplaceExisting);
using (ZipArchive archive = new ZipArchive((await zip.OpenAsync(FileAccessMode.ReadWrite)).AsStream(), ZipArchiveMode.Update))
{
ZipArchiveEntry readmeEntry = archive.CreateEntry(jpg.Name);
byte[] buffer = WindowsRuntimeBufferExtensions.ToArray(await FileIO.ReadBufferAsync(jpg));
using (var writer = readmeEntry.Open())
{
await writer.WriteAsync(buffer, 0, buffer.Length);
}
}
把1.jpg从1.zip中删除
导出1.jpg,newFile为要到出的文件
新闻热点
疑难解答