Error: "Index was outside the bounds of the array." #158

Open
opened 2026-01-29 22:07:33 +00:00 by claunia · 0 comments
Owner

Originally created by @fahmiandhika on GitHub (Mar 21, 2017).

Hi Guys,

I Have an error "Index was outside the bounds of the array." when to try extract file.
below the code

` using (Stream stream = System.IO.File.OpenRead(pathForZip))
using (var reader = ReaderFactory.Open(stream))
{
while (reader.MoveToNextEntry())
{
if (!reader.Entry.IsDirectory)
{
Console.WriteLine(reader.Entry.Key);
reader.WriteEntryToDirectory(pathForExtracting, new ExtractionOptions()
{
ExtractFullPath = true,
Overwrite = true
});
}

                }
            }`

Please advice,
Thanks

Originally created by @fahmiandhika on GitHub (Mar 21, 2017). Hi Guys, I Have an error "Index was outside the bounds of the array." when to try extract file. below the code ` using (Stream stream = System.IO.File.OpenRead(pathForZip)) using (var reader = ReaderFactory.Open(stream)) { while (reader.MoveToNextEntry()) { if (!reader.Entry.IsDirectory) { Console.WriteLine(reader.Entry.Key); reader.WriteEntryToDirectory(pathForExtracting, new ExtractionOptions() { ExtractFullPath = true, Overwrite = true }); } } }` Please advice, Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#158