Class Archive
ชื่อพื้นที่: Aspose.Zip การประกอบ: Aspose.Zip.dll (25.5.0)
คลาสนี้แสดงให้เห็นถึงไฟล์ไฟล์ zip ใช้ไฟล์นี้เพื่อประกอบ, extract หรือ update zip archives
public class Archive : IArchive, IDisposable
Inheritance
Implements
อนุญาโตตุลาการ
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
Archive(ArchiveEntrySettings)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Zip.Archive ด้วยการตั้งค่าตัวเลือกสําหรับรายการ
public Archive(ArchiveEntrySettings newEntrySettings = null)
Parameters
newEntrySettings
ArchiveEntrySettings
การกําหนดค่าการบีบอัดและการเข้ารหัสที่ใช้สําหรับรายการ Aspose.Zip.ArchiveEntry ที่เพิ่มใหม่หากไม่ได้ระบุการบีบอัด Deflate ที่พบมากที่สุดโดยไม่ต้องเข้ารหัสจะใช้
Examples
ตัวอย่างต่อไปนี้แสดงให้เห็นวิธีการบีบอัดไฟล์เดียวด้วยการตั้งค่าเริ่มต้น
using (FileStream zipFile = File.Open("archive.zip", FileMode.Create))
{
using (var archive = new Archive())
{
archive.CreateEntry("data.bin", "file.dat");
archive.Save(zipFile);
}
}
Archive(กระแส, ArchiveLoadOptions, ArchiveEntrySettings)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Zip.Archive และประกอบรายการเข้าที่สามารถสกัดจากเอกสาร
public Archive(Stream sourceStream, ArchiveLoadOptions loadOptions = null, ArchiveEntrySettings newEntrySettings = null)
Parameters
sourceStream
Stream
แหล่งกําเนิดของไฟล์
loadOptions
ArchiveLoadOptions
ตัวเลือกในการโหลดไฟล์ที่มีอยู่ด้วย
newEntrySettings
ArchiveEntrySettings
การกําหนดค่าการบีบอัดและการเข้ารหัสที่ใช้สําหรับรายการ Aspose.Zip.ArchiveEntry ที่เพิ่มใหม่หากไม่ได้ระบุการบีบอัด Deflate ที่พบมากที่สุดโดยไม่ต้องเข้ารหัสจะใช้
Examples
ตัวอย่างต่อไปนี้จะ extract a encrypted archive จากนั้น decompresses the first entry to a .
var fs = File.OpenRead("encrypted.zip");
var extracted = new MemoryStream();
using (Archive archive = new Archive(fs, new ArchiveLoadOptions() { DecryptionPassword = "p@s$" }))
{
using (var decompressed = archive.Entries[0].Open())
{
byte[] b = new byte[8192];
int bytesRead;
while (0 < (bytesRead = decompressed.Read(b, 0, b.Length)))
extracted.Write(b, 0, bytesRead);
}
}
Remarks
ผู้ก่อสร้างนี้ไม่บีบอัดส่วนใด ๆ ดู Aspose.Zip.ArchiveEntry.Open(System.String) วิธีการบีบอัด
Exceptions
sourceStream’ is not seekable.
หัวฉลากการเข้ารหัสสําหรับ AES มีข้อตกลงกับวิธีการบีบอัด WinZip
Archive(string, ArchiveLoadOptions, ArchiveEntrySettings)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Zip.Archive และประกอบรายการเข้าที่สามารถสกัดจากเอกสาร
public Archive(string path, ArchiveLoadOptions loadOptions = null, ArchiveEntrySettings newEntrySettings = null)
Parameters
path
string
การรับรองเต็มรูปแบบหรือเส้นทางที่เกี่ยวข้องกับไฟล์สํารองข้อมูล
loadOptions
ArchiveLoadOptions
ตัวเลือกในการโหลดไฟล์ที่มีอยู่ด้วย
newEntrySettings
ArchiveEntrySettings
การกําหนดค่าการบีบอัดและการเข้ารหัสที่ใช้สําหรับรายการ Aspose.Zip.ArchiveEntry ที่เพิ่มใหม่หากไม่ได้ระบุการบีบอัด Deflate ที่พบมากที่สุดโดยไม่ต้องเข้ารหัสจะใช้
Examples
ตัวอย่างต่อไปนี้จะ extract a encrypted archive จากนั้น decompresses the first entry to a .
var extracted = new MemoryStream();
using (Archive archive = new Archive("encrypted.zip", new ArchiveLoadOptions() { DecryptionPassword = "p@s$" }))
{
using (var decompressed = archive.Entries[0].Open())
{
byte[] b = new byte[8192];
int bytesRead;
while (0 < (bytesRead = decompressed.Read(b, 0, b.Length)))
extracted.Write(b, 0, bytesRead);
}
}
Remarks
ผู้ก่อสร้างนี้ไม่บีบอัดส่วนใด ๆ ดู Aspose.Zip.ArchiveEntry.Open(System.String) วิธีการบีบอัด
Exceptions
path’ is null.
ผู้โทรไม่ได้รับอนุญาตให้เข้าถึง
path" เป็นที่ว่างเปล่ามีพื้นที่สีขาวเท่านั้นหรือมีตัวอักษรที่ไม่ถูกต้อง
การเข้าถึงไฟล์ path" ถูกปฏิเสธ
ระบุ path’, ชื่อไฟล์, หรือทั้งสองเกินความยาวสูงสุดที่กําหนดโดยระบบ ตัวอย่างเช่นบนแพลตฟอร์มที่ใช้ Windows, เส้นทางจะต้องน้อยกว่า 248 หมายเลขและชื่อไฟล์จะต้องน้อยกว่า 260 หมายเลข
ไฟล์ใน path" มีคอลัมน์ (:) ในส่วนกลางของเส้น
ไฟล์ไม่ได้พบ
เส้นทางที่ระบุไม่ถูกต้องเช่นอยู่บนไดรฟ์ที่ไม่มีแผนที่
ไฟล์นี้เปิดแล้ว
ไฟล์นี้ถูกละเมิด
Archive(รั้ว, รั้ว[ ], ArchiveLoadOptions)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Zip.Archive จากไฟล์ zip มัลติวาล์วและประกอบรายการที่สามารถสกัดจากไฟล์
public Archive(string mainSegment, string[] segmentsInOrder, ArchiveLoadOptions loadOptions = null)
Parameters
mainSegment
string
ขั้นตอนไปยังส่วนสุดท้ายของไฟล์หลายปริมาณพร้อมไดเรกทอรีกลาง
โดยปกติส่วนนี้มี *.zip extension และขนาดเล็กกว่าอื่น ๆ
segmentsInOrder
string
[ ]
ขั้นตอนไปยังแต่ละส่วน แต่สุดท้ายของไฟล์ zip มัลติปริมาณที่ปฏิบัติตามคําสั่ง
โดยปกติพวกเขาเรียก filename.z01, filename.z02, …, filename.z(n-1).
loadOptions
ArchiveLoadOptions
ตัวเลือกในการโหลดไฟล์ที่มีอยู่ด้วย
Examples
ตัวอย่างนี้จะดึงไปยังไดเรกทอรีไฟล์ของสามส่วน
using (Archive a = new Archive("archive.zip", new string[] { "archive.z01", "archive.z02" }))
{
a.ExtractToDirectory("destination");
}
Exceptions
ไม่สามารถโหลดหัว ZIP เพราะไฟล์ที่จัดไว้จะถูกทําลาย
Properties
Entries
ได้รับการเข้าสู่ระบบของ Aspose.Zip.ArchiveEntry ประเภทที่สร้างเอกสาร
public ReadOnlyCollection<archiveentry> Entries { get; }
คุณสมบัติมูลค่า
ReadOnlyCollection < ArchiveEntry >
NewEntrySettings
การกําหนดค่าการบีบอัดและการเข้ารหัสที่ใช้สําหรับรายการ Aspose.Zip.ArchiveEntry ที่เพิ่มใหม่
public ArchiveEntrySettings NewEntrySettings { get; }
คุณสมบัติมูลค่า
Methods
CreateEntries(DirectoryInfo, บอล)
เพิ่มไฟล์และไดเรกทอรีทั้งหมดในแถลงการณ์ที่ระบุ
public Archive CreateEntries(DirectoryInfo directory, bool includeRootDirectory = true)
Parameters
directory
DirectoryInfo
คู่มือการบีบอัด
includeRootDirectory
bool
แสดงให้เห็นว่าจะรวมกล่องรากตัวเองหรือไม่
Returns
ไฟล์ที่ประกอบด้วยรายการ
Examples
using (Archive archive = new Archive())
{
DirectoryInfo folder = new DirectoryInfo("C:\folder");
archive.CreateEntries(folder);
archive.Save("folder.zip");
}
Exceptions
เส้นทางไปยัง directory" ไม่สามารถใช้งานได้เช่นอยู่บนไดรฟ์ที่ไม่ได้ทําเครื่องหมาย
ผู้โทรไม่ได้รับอนุญาตที่จําเป็นในการเข้าถึง directory".
CreateEntries(บอล, บอล)
เพิ่มไฟล์และไดเรกทอรีทั้งหมดในแถลงการณ์ที่ระบุ
public Archive CreateEntries(string sourceDirectory, bool includeRootDirectory = true)
Parameters
sourceDirectory
string
คู่มือการบีบอัด
includeRootDirectory
bool
แสดงให้เห็นว่าจะรวมกล่องรากตัวเองหรือไม่
Returns
ไฟล์ที่ประกอบด้วยรายการ
Examples
using (Archive archive = new Archive())
{
archive.CreateEntries("C:\folder");
archive.Save("folder.zip");
}
CreateEntry(string, string, bool, ArchiveEntrySettings)
สร้างรายการเดียวภายในเอกสาร
public ArchiveEntry CreateEntry(string name, string path, bool openImmediately = false, ArchiveEntrySettings newEntrySettings = null)
Parameters
name
string
ชื่อของรายการ
path
string
ชื่อไฟล์ใหม่ที่มีคุณภาพเต็มรูปแบบหรือชื่อไฟล์ที่เกี่ยวข้องที่จะถูกบีบอัด
openImmediately
bool
จริงๆถ้าคุณเปิดไฟล์ได้ทันทีหรือเปิดไฟล์ที่บันทึกไฟล์
newEntrySettings
ArchiveEntrySettings
การกําหนดค่าการบีบอัดและการเข้ารหัสที่ใช้สําหรับการเพิ่ม Aspose.Zip.ArchiveEntry รายการ
Returns
การเข้าสู่ระบบ ZIP
Examples
using (FileStream zipFile = File.Open("archive.zip", FileMode.Create))
{
using (var archive = new Archive())
{
archive.CreateEntry("data.bin", "file.dat");
archive.Save(zipFile);
}
}
Remarks
ชื่อเข้าตั้งไว้เฉพาะภายในพารามิเตอร์ ชื่อไฟล์ที่ระบุไว้ในพารามิเตอร์ไม่ส่งผลต่อชื่อเข้า
หากไฟล์จะเปิดโดยตรงกับพารามิเตอร์จะถูกบล็อกจนกว่าไฟล์จะถูกบันทึกไว้
Exceptions
path’ is null.
ผู้โทรไม่ได้รับอนุญาตให้เข้าถึง
path" เป็นที่ว่างเปล่ามีพื้นที่สีขาวเท่านั้นหรือมีตัวอักษรที่ไม่ถูกต้อง
การเข้าถึงไฟล์ path" ถูกปฏิเสธ
ระบุ path’, ชื่อไฟล์, หรือทั้งสองเกินความยาวสูงสุดที่กําหนดโดยระบบ ตัวอย่างเช่นบนแพลตฟอร์มที่ใช้ Windows, เส้นทางจะต้องน้อยกว่า 248 หมายเลขและชื่อไฟล์จะต้องน้อยกว่า 260 หมายเลข
ไฟล์ใน path" มีคอลัมน์ (:) ในส่วนกลางของเส้น
CreateEntry(string, กระแส, ArchiveEntrySettings)
สร้างรายการเดียวภายในเอกสาร
public ArchiveEntry CreateEntry(string name, Stream source, ArchiveEntrySettings newEntrySettings = null)
Parameters
name
string
ชื่อของรายการ
source
Stream
การเข้าสู่ระบบสําหรับเข้าสู่ระบบ
newEntrySettings
ArchiveEntrySettings
การกําหนดค่าการบีบอัดและการเข้ารหัสที่ใช้สําหรับการเพิ่ม Aspose.Zip.ArchiveEntry รายการ
Returns
การเข้าสู่ระบบ ZIP
Examples
using (var archive = new Archive(new ArchiveEntrySettings(null, new AesEcryptionSettings("p@s$", EncryptionMethod.AES256))))
{
archive.CreateEntry("data.bin", new MemoryStream(new byte[] {0x00, 0xFF} ));
archive.Save("archive.zip");
}
CreateEntry(string, FileInfo, bool, ArchiveEntrySettings)
สร้างรายการเดียวภายในเอกสาร
public ArchiveEntry CreateEntry(string name, FileInfo fileInfo, bool openImmediately = false, ArchiveEntrySettings newEntrySettings = null)
Parameters
name
string
ชื่อของรายการ
fileInfo
FileInfo
metadata ของไฟล์ที่จะถูกบีบอัด
openImmediately
bool
จริงๆถ้าคุณเปิดไฟล์ได้ทันทีหรือเปิดไฟล์ที่บันทึกไฟล์
newEntrySettings
ArchiveEntrySettings
การกําหนดค่าการบีบอัดและการเข้ารหัสที่ใช้สําหรับการเพิ่ม Aspose.Zip.ArchiveEntry รายการ
Returns
การเข้าสู่ระบบ ZIP
Examples
รวมไฟล์ที่มีรายการที่เข้ารหัสด้วยวิธีการเข้ารหัสและรหัสผ่านที่แตกต่างกันแต่ละ
using (FileStream zipFile = File.Open("archive.zip", FileMode.Create))
{
FileInfo fi1 = new FileInfo("data1.bin");
FileInfo fi2 = new FileInfo("data2.bin");
FileInfo fi3 = new FileInfo("data3.bin");
using (var archive = new Archive())
{
archive.CreateEntry("entry1.bin", fi1, false, new ArchiveEntrySettings(new DeflateCompressionSettings(), new TraditionalEncryptionSettings("pass1")));
archive.CreateEntry("entry2.bin", fi2, false, new ArchiveEntrySettings(new DeflateCompressionSettings(), new AesEcryptionSettings("pass2", EncryptionMethod.AES128)));
archive.CreateEntry("entry3.bin", fi3, false, new ArchiveEntrySettings(new DeflateCompressionSettings(), new AesEcryptionSettings("pass3", EncryptionMethod.AES256)));
archive.Save(zipFile);
}
}
Remarks
ชื่อเข้าตั้งไว้เฉพาะภายในพารามิเตอร์ ชื่อไฟล์ที่ระบุไว้ในพารามิเตอร์ไม่ส่งผลต่อชื่อเข้า
หากไฟล์จะเปิดโดยตรงกับพารามิเตอร์จะถูกบล็อกจนกว่าไฟล์จะถูกบันทึกไว้
Exceptions
fileInfo’ is read-only or is a directory.
เส้นทางที่ระบุไม่ถูกต้องเช่นอยู่บนไดรฟ์ที่ไม่มีแผนที่
ไฟล์นี้เปิดแล้ว
CreateEntry(string, Stream, ArchiveEntrySettings, FileSystemInfo)
สร้างรายการเดียวภายในเอกสาร
public ArchiveEntry CreateEntry(string name, Stream source, ArchiveEntrySettings newEntrySettings, FileSystemInfo fileInfo)
Parameters
name
string
ชื่อของรายการ
source
Stream
การเข้าสู่ระบบสําหรับเข้าสู่ระบบ
newEntrySettings
ArchiveEntrySettings
การกําหนดค่าการบีบอัดและการเข้ารหัสที่ใช้สําหรับการเพิ่ม Aspose.Zip.ArchiveEntry รายการ
fileInfo
FileSystemInfo
metadata ของไฟล์หรือโฟลเดอร์ที่จะถูกบีบอัด
Returns
การเข้าสู่ระบบ ZIP
Examples
สร้างเอกสารที่มีการเข้ารหัสเข้า
using (FileStream zipFile = File.Open("archive.zip", FileMode.Create))
{
using (var archive = new Archive())
{
archive.CreateEntry("entry1.bin", new MemoryStream(new byte[] {0x00, 0xFF} ), new ArchiveEntrySettings(new DeflateCompressionSettings(), new TraditionalEncryptionSettings("pass1")), new FileInfo("data1.bin"));
archive.Save(zipFile);
}
}
Remarks
ชื่อเข้าตั้งไว้เฉพาะภายในพารามิเตอร์ ชื่อไฟล์ที่ระบุไว้ในพารามิเตอร์ไม่ส่งผลต่อชื่อเข้า
สามารถอ้างอิงไปยัง System.IO.DirectoryInfo หากรายการเป็นไดเรกทอรี
Exceptions
ทั้ง source’ และ
fileInfo’ เป็น null หรือ
source’ เป็น null และ
fileInfo’ เป็นตัวแทนสําหรับตาราง
CreateEntry(ลวด, Func, ArchiveEntrySettings)
สร้างรายการเดียวภายในเอกสาร
public ArchiveEntry CreateEntry(string name, Func<stream> streamProvider, ArchiveEntrySettings newEntrySettings = null)
Parameters
name
string
ชื่อของรายการ
streamProvider
Func
<
Stream
>
วิธีการให้การไหล input สําหรับการเข้า
newEntrySettings
ArchiveEntrySettings
การกําหนดค่าการบีบอัดและการเข้ารหัสที่ใช้สําหรับการเพิ่ม Aspose.Zip.ArchiveEntry รายการ
Returns
การเข้าสู่ระบบ ZIP
Examples
สร้างเอกสารที่มีการเข้ารหัสเข้า
System.Func<Stream> provider = delegate(){ return new MemoryStream(new byte[]{0xFF, 0x00}); };
using (FileStream zipFile = File.Open("archive.zip", FileMode.Create))
{
using (var archive = new Archive())
{
archive.CreateEntry("entry1.bin", provider, new ArchiveEntrySettings(new DeflateCompressionSettings(), new TraditionalEncryptionSettings("pass1"))));
archive.Save(zipFile);
}
}
Remarks
วิธีการนี้ใช้สําหรับ .NET Framework 4.0 และสูงกว่าและสําหรับ .NET Standard 2.0 รุ่น
DeleteEntry(ArchiveEntry)
ลบการปรากฏตัวครั้งแรกของรายการที่เฉพาะเจาะจงจากรายการรายการ
public Archive DeleteEntry(ArchiveEntry entry)
Parameters
entry
ArchiveEntry
การเข้าสู่ระบบที่จะถอดออกจากรายการเข้าสู่ระบบ
Returns
ไฟล์ที่มีการเข้าสู่ระบบลบ
Examples
นี่คือวิธีที่คุณสามารถลบรายการทั้งหมดยกเว้นครั้งสุดท้าย:
using (var archive = new Archive("archive.zip"))
{
while (archive.Entries.Count > 1)
archive.DeleteEntry(archive.Entries[0]);
archive.Save("last_entry.zip");
}
Exceptions
ไฟล์นี้ถูกจัดเก็บไว้
DeleteEntry(int)
ลบป้อนจากรายการป้อนโดย index
public Archive DeleteEntry(int entryIndex)
Parameters
entryIndex
int
อัตราการเข้าสู่ระบบที่ต้องถูกลบ
Returns
ไฟล์ที่มีการเข้าสู่ระบบลบ
Examples
using (var archive = new TarArchive("two_files.zip"))
{
archive.DeleteEntry(0);
archive.Save("single_file.zip");
}
Exceptions
ไฟล์จะถูกปล่อยออก
entryIndex’ is less than 0.-or-
entryIndex’ is equal to or greater than ‘Entries’ count.
Dispose()
ทําหน้าที่ที่กําหนดโดยการใช้งานที่เกี่ยวข้องกับการปล่อยทรัพยากรที่ไม่ได้รับการจัดการหรือรีไซเคิล
public void Dispose()
Dispose(บอล)
ทําหน้าที่ที่กําหนดโดยการใช้งานที่เกี่ยวข้องกับการปล่อยทรัพยากรที่ไม่ได้รับการจัดการหรือรีไซเคิล
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
ไม่ว่าทรัพยากรที่จัดการควรจะถูกกําจัด
ExtractToDirectory(รั้ว)
extract all the files in the archive to the directory provided
public void ExtractToDirectory(string destinationDirectory)
Parameters
destinationDirectory
string
เส้นทางไปยังไดเรกทอรีเพื่อวางไฟล์ที่สกัด
Examples
using (var archive = new Archive("archive.zip"))
{
archive.ExtractToDirectory("C:\extracted");
}
Remarks
หากไดเรกทอรีไม่ได้มีมันจะถูกสร้างขึ้น
Exceptions
destinationDirectory’ is null.
เส้นทางที่ระบุชื่อไฟล์หรือทั้งสองเกินความยาวสูงสุดที่กําหนดโดยระบบ ตัวอย่างเช่นบนแพลตฟอร์มที่ใช้ Windows เส้นทางจะต้องน้อยกว่า 248 หมายเลขและชื่อไฟล์จะต้องน้อยกว่า 260 หมายเลข
ผู้โทรไม่ได้รับอนุญาตที่จําเป็นในการเข้าถึงไดเรกทอรีที่มีอยู่
หากไดเรกทอรีไม่ได้มีเส้นทางมีตัวอักษรของ colon (:) ซึ่งไม่ได้เป็นส่วนหนึ่งของแท็กไดรฟ์ (“C:”).
destinationDirectory’ is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the System.IO.Path.GetInvalidPathChars method.-or- path is prefixed with, or contains, only a colon character (:).
แผนที่ที่ระบุโดยเส้นทางเป็นไฟล์ -หรือ- ชื่อเครือข่ายไม่ทราบ
โพสต์รหัสผ่านที่ผิดพลาด - หรือ - Archive is corrupt.
Save(กระแส, ArchiveSaveOptions)
เก็บไฟล์ไปยังกระแสที่ให้
public void Save(Stream outputStream, ArchiveSaveOptions saveOptions = null)
Parameters
outputStream
Stream
การไหลของเป้าหมาย
saveOptions
ArchiveSaveOptions
ตัวเลือกการบันทึกไฟล์
Examples
using (FileStream zipFile = File.Open("archive.zip", FileMode.Create))
{
using (var archive = new Archive())
{
archive.CreateEntry("entry.bin", "data.bin");
archive.Save(zipFile);
}
}
Remarks
จําเป็นต้องเขียนได้
Exceptions
outputStream’ is not writable.
ไฟล์นี้ถูกจัดเก็บไว้
Save(แถบ, ArchiveSaveOptions)
บันทึกไฟล์ไปยังไฟล์ปลายทางที่ให้
public void Save(string destinationFileName, ArchiveSaveOptions saveOptions = null)
Parameters
destinationFileName
string
วิธีของไฟล์ที่จะสร้าง หากชื่อไฟล์ที่ระบุหมายถึงไฟล์ที่มีอยู่มันจะถูกเขียนเกินไป
saveOptions
ArchiveSaveOptions
ตัวเลือกการบันทึกไฟล์
Examples
using (var archive = new Archive())
{
archive.CreateEntry("entry.bin", "data.bin");
archive.Save("archive.zip", new ArchiveSaveOptions() { Encoding = Encoding.ASCII });
}
Remarks
มันเป็นไปได้ที่จะบันทึกไฟล์ไปยังเส้นทางเดียวกันเมื่อมันถูกโหลด จาก อย่างไรก็ตามนี่ไม่แนะนําเพราะวิธีการนี้ใช้การคัดลอกไปยังไฟล์ชั่วคราว
Exceptions
destinationFileName’ is null.
ผู้โทรไม่ได้รับอนุญาตให้เข้าถึง
destinationFileName’ เป็นที่ว่างเปล่ามีพื้นที่สีขาวเท่านั้นหรือมีตัวอักษรที่ไม่ถูกต้อง
การเข้าถึงไฟล์ destinationFileName’ ถูกปฏิเสธ
ระบุ destinationFileName’, ชื่อไฟล์, หรือทั้งสองเกินความยาวสูงสุดที่กําหนดโดยระบบ ตัวอย่างเช่นบนแพลตฟอร์มที่ใช้ Windows, เส้นทางจะต้องน้อยกว่า 248 หมายเลขและชื่อไฟล์จะต้องน้อยกว่า 260 หมายเลข
ไฟล์ที่ destinationFileName’ มีคอลัมน์ (:) ในส่วนกลางของเส้น
ไฟล์ไม่ได้พบ
เส้นทางที่ระบุไม่ถูกต้องเช่นอยู่บนไดรฟ์ที่ไม่มีแผนที่
ไฟล์นี้เปิดแล้ว
SaveSplit(ลวด, SplitArchiveSaveOptions)
บันทึกไฟล์หลายปริมาณไปยังไดเรกทอรีปลายทางที่ให้
public void SaveSplit(string destinationDirectory, SplitArchiveSaveOptions options)
Parameters
destinationDirectory
string
เส้นทางไปยังไดเรกทอรีที่องค์ประกอบเอกสารจะถูกสร้าง
options
SplitArchiveSaveOptions
ตัวเลือกการบันทึกไฟล์รวมถึงชื่อไฟล์
Examples
using (Archive archive = new Archive())
{
archive.CreateEntry("entry.bin", "data.bin");
archive.SaveSplit(@"C:\Folder", new SplitArchiveSaveOptions("volume", 65536));
}
Remarks
วิธีการนี้ประกอบด้วยไฟล์หลาย () filename.z01, filename.z02, …, filename.z(n-1), filename.zip
ไม่สามารถสร้างไฟล์ที่มีอยู่หลายปริมาณ
Exceptions
ไฟล์นี้ถูกเปิดจากแหล่งที่มีอยู่
ไฟล์นี้ถูกบีบอัดด้วยวิธีการ XZ และเข้ารหัส
destinationDirectory’ is null.
ผู้โทรไม่ได้รับอนุญาตที่จําเป็นในการเข้าถึงไดเรกทอรี
destinationDirectory’ contains invalid characters such as “, >, <, or |.
เส้นทางที่ระบุเกินความยาวสูงสุดที่กําหนดโดยระบบ
ไฟล์นี้ถูกจัดเก็บไว้