0
我想用Telerik Wpf Zip實用工具壓縮MemoryStream。我通過從接受ms文件,名稱爲Zip Archive的Telerik文檔複製以下方法,並且使用密碼Telerik從memoryStream製作Zip文件
private static MemoryStream MakeZipFile(MemoryStream ms, string ZipFileName, string pass)
{
MemoryStream msZip = new MemoryStream();
DefaultEncryptionSettings encryptionSettings = new DefaultEncryptionSettings();
encryptionSettings.Password = pass;
using (ZipArchive archive = new ZipArchive(msZip, ZipArchiveMode.Create, false, null, null, encryptionSettings))
{
using (ZipArchiveEntry entry = archive.CreateEntry(ZipFileName))
{
// Here I don't know how to add my ms to the archive, and return msZip
}
}
任何幫助將不勝感激。