我希望创建文件zip在窗口商店应用程序(winrt)中有密码。
我使用了sharpcompress https://sharpcompress.codeplex.com/ 但不是创建文件zip有密码。
你可以帮帮我吗?答案 0 :(得分:1)
我在Windows 8.1中使用Dotnetzip。
https://www.nuget.org/packages/DotNetZipforWindows8.1/
它支持写入和读取文件zip有密码
using Ionic.Zip;
void WriteFile()
{
string s = Windows.Storage.ApplicationData.Current.TemporaryFolder.Path;
System.Diagnostics.Debug.WriteLine(s);
using (ZipFile zip = new ZipFile())
{
zip.Password = "123456!";
zip.Encryption = EncryptionAlgorithm.PkzipWeak;
zip.AddFile(s + "\\SaveXML.xml", "");
zip.AddFile(s + "\\Advanced_Windows_Store_App_Development_Using_C#_Exam_Ref_70-485.pdf", "");
zip.Save(s + "\\MyZipFile123.zip");
}
}