????????? XAR

?????

Xar � ?????????? ?????? ??????????? ? Mac OS. ?? ?????? ??????????? ????? ????? ?? ????????? Aspose.Zip ??? ????, ?? ? ???? ??????.

Aspose.Zip ???? ?????????? ?????? XAR, ???????? ?? ????????? gzip, bzip2, lzma.

??????? ?????

????????? ??????? ??????? ?????? ? ?????? ???? ?? ?????.

?????: ??????????? ??????? ? ?????? XAR ? C#

  1. ?????????, ?? ????? ??????? C:\extracted; ???????? ????, ???? ?? ?????????.
  2. ????????? ????? XAR ?? ????????? XarArchive(“data.xar”).
  3. ??????????? ????? ????? ? ??????.
  4. ???? ????? ? ??????, ?????????? ???? ?? C:\extracted.
  5. ???? ????? ? ?????????, ???????? ??????????? ??????? ? C:\extracted.
 1    if (!Directory.Exists("C:\\extracted"))
 2    {
 3        Directory.CreateDirectory("C:\\extracted");
 4    }
 5
 6    using(XarArchive xarArchive =  new XarArchive("data.xar"))
 7    {
 8        foreach (XarEntry entry in xarArchive.Entries) 
 9        {
10            if (entry is XarFileEntry xarFileEntry)
11            {
12                var entryPath = Path.Combine("C:\\extracted", entry.FullPath);
13                xarFileEntry.Extract(entryPath);
14            }
15            else if (entry is XarDirectoryEntry)
16            {
17                var entryPath = Path.Combine("C:\\extracted", entry.FullPath);
18                Directory.CreateDirectory(entryPath);
19            }
20        }
21    }

???????? ???? ?????

????????? ??????? ??????? ???? ????? ?? ????????.

1    using (XarArchive xarArchive = new XarArchive("data.xar"))
2    {
3        xarArchive.ExtractToDirectory("data");
4    }

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.