@ Я получу ту же ошибку, когда поступлю согласно комментарию: zip.AlternateEncodingUsage = ZipOption.Always;
аюсь заархивировать файл или каталог в C #, используя следующий фрагмент кода на Mac, который использует DotNetZip. Но я получаю некоторые исключения ниже, что я делаю не так?
using Ionic.Zip;
namespace CSLab
{
class Program
{
static void Main(string[] args)
{
using (ZipFile zip = new ZipFile())
{
zip.Password = "password";
zip.AddDirectory("./test");
zip.Save("a.zip");
}
}
}
}
Unhandled Exception: System.ArgumentException: 'IBM437' is not a
supported encoding name. For information on defining a custom
encoding, see the documentation for the Encoding.RegisterProvider method.
Parameter name: name
at System.Globalization.EncodingTable.GetCodePageFromName(String name)
at System.Text.Encoding.GetEncoding(String name)
at Ionic.Zip.ZipFile..ctor()
at CSLab.Program.Main(String[] args) in
bash: line 1: 17217 Abort trap: 6
"/usr/local/share/dotnet/dotnet"
"/usr../bin/Debug/netcoreapp2.0/CSLab.dll"