forked from adoconnection/SevenZipExtractor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
38 lines (33 loc) · 1023 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.IO;
using SevenZipExtractor;
namespace ConsoleApplication86
{
class Program
{
static void Main(string[] args)
{
using (ArchiveFile archiveFile = new ArchiveFile(@"Archive.arj"))
{
// extract all
archiveFile.Extract("Output");
}
using (ArchiveFile archiveFile = new ArchiveFile("archive.arj"))
{
foreach (Entry entry in archiveFile.Entries)
{
Console.WriteLine(entry.FileName);
// extract to file
entry.Extract(entry.FileName);
// extract to stream
MemoryStream memoryStream = new MemoryStream();
entry.Extract(memoryStream);
}
}
Console.WriteLine("");
Console.WriteLine("done");
Console.ReadKey();
}
}
}