??? ????? ??? ??????? ?????? ? ??????? C#
?????
? ???? ?????? ???????????, ??? ??????? ??? ????????? ??????. ??? ????? ???? ?????? Zip, 7z, Rar ? ?????? ???????? ????????. ?? ?????????? ????????? ????.
??????: ZIP
??????: ZIP � ??????
??????: 7z
??????: RAR
?????? ????, ?????????? ? ???? ??????.
C# ?????? ??? ?????????? ???????
?? ???? ???????? ????????, ??? ????????? ??????????? ???????? ? ???????? ?? C# ? ??????? Aspose.ZIP for .NET. ????? Aspose.ZIP ????? ???????? ? ?????? .NET ? ??????? ????????? ??????? NuGet:
1PM> Install-Package Aspose.Zip??? ????? ????? ???????? ??????????????? ? ?????? .NET ? ???????? ?????? ?? ??????. ?????????? Aspose.ZIP ????? ????????? ? ????? ???????? ????????: https://products.aspose.com/zip/net/.
?????????? Aspose.ZIP .NET ????? ???????????? ? ????? ??, ?????????????? .NET Core (????????, Windows, Linux ??? macOS).
??? ??????? ZIP-????? ? C#
????: ???????? Zip-????? ?? C#
- ???????? ????????? ?????? ?????.
- ???????? ????? ? ??????? ?????? Archive.CreateEntry.
- ????????????? ????? ??????? Archive.Save.
1using (var archive = new Archive())
2{
3 archive.CreateEntry("entry_name1.dat", "input_file1.dat");
4 archive.CreateEntry("entry_name2.dat", "input_file2.dat");
5 archive.Save("result_archive.zip");
6}??????????? ?????? Archive ??????? ??????? ZIP-?????, ????????? ???????? ?????? Deflate ? ??? ??????????.
??? ??????????????? ????? ?? C#
????: ?????????????? ???? ? ????? ?? C#
- ???????? ????????? ?????? ????? ? ????? zip-??????.
- ?????????????? zip-???? ? ??????? ?????? Archive.ExtractToDirectory ? ???? ?????.
1using (var archive = new Archive("input_archive.zip"))
2{
3 archive.ExtractToDirectory("\\outputDirectory");
4}??????????? ?????? ?????? ????? ??????? ????? ZIP-?????. ArchiveLoadOptions ??????? ??????? ? ???????? ??????? ?????????, ???? ??????? ????? ??????? ??????? (??. ?????? ????).
??? ????? ????? 7z ? C#
????: ???????? ??????? 7z ?? C#
- ???????? ????????? ?????? SevenZipArchive ? ??????? SevenZipLZMACompressionSettings.
- ???????? ?????, ?????? ????? SevenZipArchive.CreateEntries.
- ????????? ??? ? ??????? 7z, ?????? ????? SevenZipArchive.Save.
1using (var archive = new SevenZipArchive(new SevenZipEntrySettings(new SevenZipLZMACompressionSettings())))
2{
3 archive.CreateEntries(CommonConstants.TestFilesFolder + "ManyFilesToCompress");
4 archive.Save(CommonConstants.TestOutFolder + "7Z_ManyFilesToCompress.7z");
5}??????????? ?????? SevenZipArchive ??????? ???????????? ??? ???????? ?????? ?????? 7z. ? ??????????? ???? ??????? ???????????? ???????????? ?????? LZMA, ?? ????? ???????? ?????? ???????? ?????? ? ??????????.
??? ??????? ????? 7z ? C#
- ???????? ????????? ?????? SevenZipArchive ? ????? ?????? 7z.
- ????????? ?????????? ????? 7z, ?????? ????? SevenZipArchive.ExtractToDirectory.
1using (var archive = new SevenZipArchive("input_archive.7z"))
2{
3 archive.ExtractToDirectory("\\outputDirectory");
4}? ??????????? ???? ??????? ??????????? ?????? SevenZipArchive ????????? ???????????? ????? 7z.
??? ??????? ????? RAR ? C#
????: ????????? ???? RAR ?? C#
- ???????? ????????? ?????? RarArchive ? ????? RAR-??????.
- ????????? ?????????? ????? RAR, ?????? ????? RarArchive.ExtractToDirectory.
1using (var archive = new RarArchive("input_archive.rar"))
2{
3 archive.ExtractToDirectory("\\outputDirectory");
4}? ??????????? ???? ??????? ??????????? ?????? RarArchive ????????? ???????????? ????? RAR.
??? ?????????????? ????? ? ??????? ?? C#
????: ???????? Zip-???? ? ??????? ?? C#< /?>
- ???????? ????????? ?????? ?????.
- ????????? ??? ArchiveEntrySettings ? ?????????? ???????? encryptionSettings ? ???????? TraditionalEncryptionSettings, ??????? ??? ??????.
- ???????? ??? ????? ?????? ??????, ?????? ????? Archive.CreateEntry ????????? ???.
- ????????? ??? ??? Zip-????, ????????? ????? Archive.Save.
1using (var archive = new Archive(new ArchiveEntrySettings(encryptionSettings: new TraditionalEncryptionSettings("pass"))))
2{
3 archive.CreateEntry("entry_name1.dat", "input_file1.dat");
4 archive.CreateEntry("entry_name2.dat", "input_file2.dat");
5 archive.Save("result_archive.zip");
6}???????? ??????????Settings ???????????? ??? ???????? ZIP-??????, ??????????? ???????.
??? ??????????? ????? ? ??????? ?? C#
????: ?????????????? ZIP-????, ?????????? ???????, ? ??????? C#< /?>
- ???????? ????????? ?????? ?????.
- ????????? ??? ?????? ArchiveLoadOptions ? ?????????? ???????? DecryptionPassword ? ????? zip-?????? password.
- ?????????????? zip-???? ? ??????? ?????? Archive.ExtractToDirectory ? ???? ?????.
1using (var archive = new Archive("input_archive.zip", new ArchiveLoadOptions{DecryptionPassword = "pass"}))
2{
3 archive.ExtractToDirectory("\\outputDirectory");
4}ArchiveLoadOptions ?? ????????? ???????? DecryptionPassword ???????????? ??? ???????? ZIP-??????, ??????????? ???????.
??. ?????
? ???? ?????? ????? ??????????????? ??? ????. ???? ????? ??, ??? ??????? ????.
- ??????
- Zip-???? C#
- Zip-????? C#
- C# ??????? ZIP-?????
- C# Zip ????????? ??????
- C# ???????? ???? ? ZIP
- C# ?????? ?????? ? Zip
- C# ?????????? ????? ? Zip
- C# ??? ?????????????? ????
- ??????????
- ??????????????? ???? C#
- ??????????? ????? C#
- ??????? ZIP-????? C#
- C# ??? ??????????? ????
- ?????? ???????? ???????
- Zip-???? C# ? ???????
- Zip-????? C# ? ???????
- ?????? ?????? C# ? ZIP, ?????????? ???????
- C# ?????????? ????? ? Zip ? ??????? ???????
- ?????????? ???????? ???????
- C# UnZip File, ?????????? ???????
- C# ?????????? ??????, ?????????? ???????
- ?????????? ZIP-?????? C#, ??????????? ???????
- C# ??? ??????????? ???? ? ??????? ???????
??????: ZIP
- ??????
- ???? C# 7z
- ????? C# 7z
- C# ??????? ????? 7z
- ????????? ?????? C# 7z
- C# ???????? ???? ? 7z
- C# ?????? ?????? ? 7z
- C# ?????????? ????? ? 7z
- C# ??? 7z ????
- ??????????
- C# ?????????? ????? 7z
- C# ?????????? ?????? 7z
- ?????????? ????? C# 7z
- ?????????? ?????? 7z ?? C#
- ?????????? ?????? C# 7z
- C# ??? ??????? ???? 7z
??????: 7z