Ich habe ein Problem damit, ein Archiv zu erstellen und einen Verzeichniseintrag hinzuzufügen. Mein Code sieht wie folgt aus: < /p>
using (var zip = ZipFile.Create(zipPath))
{
if (!string.IsNullOrEmpty(password))
{
zip.ZipCryptoEncoding = Encoding.UTF8;
zip.Password = password;
}
zip.UseZip64 = UseZip64.Dynamic;
var EntryFactory = new ZipEntryFactory();
ZipEntry dirEntry = EntryFactory.MakeDirectoryEntry(dirPath);
dirEntry.DateTime = DateTime.Now;
dirEntry.IsUnicodeText = true;
if (!string.IsNullOrEmpty(password))
{
dirEntry.AESKeySize = 256;
}
if (!compression)
{
dirEntry.CompressionMethod = CompressionMethod.Stored;
}
if (compression)
{
dirEntry.CompressionMethod = CompressionMethod.Deflated;
}
zip.BeginUpdate();
zip.Add(dirEntry);
zip.CommitUpdate();
}
< /code>
Es wird eine Ausnahme "Eintrag können keine Daten haben." Gibt es eine Möglichkeit, eine ZIP -Datei Verzeichniseintrag hinzuzufügen?
IcSharpCode.sharpziplib.zip erstellen Sie ZIP mit Verzeichniseintrag. "Eintrag kann keine Daten haben" ⇐ C#
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Holen Sie sich beim Drücken der Taste die Eingabe in Python Tkinter -Eintrag
by Anonymous » » in Python - 0 Replies
- 6 Views
-
Last post by Anonymous
-