IronZIP ile Başlarken
IronZIP: .NET için Tüm Birleşik Arşiv Kütüphaneniz
IronZIP, Iron Software tarafından geliştirilen bir arşiv sıkıştırma ve ayıklama kütüphanesidir. Geniş çapta kullanılan ZIP formatına ek olarak TAR, GZIP ve BZIP2 formatlarını da işleyebilir.
C# Arşiv Sıkıştırma ve Açma Kütüphanesi
- Dosya sıkıştırma ve açma için C# kütüphanesini indirin
- ZIP, TAR, GZIP ve BZIP2 formatlarını işleyin
- 0 ila 9 arasında sıkıştırma seviyelerini özelleştirin
- Sıkıştırılmış arşivlerden içerik çıkartın
- Mevcut ZIP arşivlerine dosyalar ekleyin ve yeni ZIP dosyaları oluşturun
Uyumluluk
IronZIP, aşağıdaki çapraz platform desteğine sahiptir:
.NET Sürüm Desteği:
- C#, VB.NET, F#
- .NET 7, 6, 5, ve Core 3.1+
- .NET Standard (2.0+)
- .NET Framework (4.6.2+)
İşletim Sistemleri ve Ortam Desteği:
- Windows (10+, Server 2016+)
- Linux (Ubuntu, Debian, CentOS, vb.)
- macOS (10+)
- iOS (12+)
- Android API 21+ (v5 "Lollipop")
- Docker (Windows, Linux, Azure)
- Azure (VPS, WebApp, Function)
- AWS (EC2, Lambda)
.NET Proje Türleri Desteği:
- Web (Blazor & WebForms)
- Mobil (Xamarin & MAUI)
- Masaüstü (WPF & MAUI)
- Konsol (Uygulama & Kütüphane)
Kurulum
IronZIP Kütüphanesi
Terminalinizde veya paket yöneticisi konsolunuzda aşağıdaki komutu kullanarak IronZIP paketini kurun:
Alternatif olarak, doğrudan resmi IronZIP NuGet websitesinden indirebilirsiniz.
Kurulum tamamlandıktan sonra, C# kodunuzun başına using IronZip; ekleyerek başlayabilirsiniz.
Lisans Anahtarı Uygulama
Sonrasında, IronZIP bazı lisans anahtarını veya deneme anahtarını IronZIP'in License sınıfının LicenseKey özelliğine atayarak uygulayın. Import ifadesinin hemen ardından ve herhangi bir IronZIP yöntemini kullanmadan önce aşağıdaki kodu ekleyin:
using IronZip;
// Apply your license key here
IronZip.License.LicenseKey = "YOUR_LICENSE_KEY";Imports IronZip
' Apply your license key here
IronZip.License.LicenseKey = "YOUR_LICENSE_KEY"Imports IronZip
' Apply your license key here
IronZip.License.LicenseKey = "YOUR_LICENSE_KEY"Kod Örnekleri
Arşiv Oluşturma Örneği
using ifadesini kullanarak bir ZIP dosyası oluşturun. using bloğu içinde, dosyaları ZIP dosyasına aktarmak için AddArchiveEntry metodunu kullanın. Son olarak, ZIP dosyasını SaveAs metoduyla dışa aktarın.
using IronZip;
using System.IO;
class Program
{
static void Main()
{
// Create a new ZIP file
using (var archive = new ZipArchive())
{
// Add a file to the archive
archive.AddArchiveEntry("example.txt", File.ReadAllBytes("path/to/example.txt"));
// Save the ZIP archive
archive.SaveAs("archive.zip");
}
}
}using IronZip;
using System.IO;
class Program
{
static void Main()
{
// Create a new ZIP file
using (var archive = new ZipArchive())
{
// Add a file to the archive
archive.AddArchiveEntry("example.txt", File.ReadAllBytes("path/to/example.txt"));
// Save the ZIP archive
archive.SaveAs("archive.zip");
}
}
}Imports IronZip
Imports System.IO
Friend Class Program
Shared Sub Main()
' Create a new ZIP file
Using archive = New ZipArchive()
' Add a file to the archive
archive.AddArchiveEntry("example.txt", File.ReadAllBytes("path/to/example.txt"))
' Save the ZIP archive
archive.SaveAs("archive.zip")
End Using
End Sub
End ClassImports IronZip
Imports System.IO
Friend Class Program
Shared Sub Main()
' Create a new ZIP file
Using archive = New ZipArchive()
' Add a file to the archive
archive.AddArchiveEntry("example.txt", File.ReadAllBytes("path/to/example.txt"))
' Save the ZIP archive
archive.SaveAs("archive.zip")
End Using
End Sub
End ClassArşivi Klasöre Çıkartın
ZIP dosyasının içeriğini ExtractArchiveToDirectory metodunu kullanarak çıkarın. Hedef ZIP dosyası yolunu ve çıkarma dizinini belirtin.
using IronZip;
class Program
{
static void Main()
{
// path to the ZIP file and extraction directory
string zipPath = "archive.zip";
string extractPath = "extracted/";
// Extract all files in the ZIP archive to the specified directory
using (var archive = new ZipArchive(zipPath))
{
archive.ExtractArchiveToDirectory(extractPath);
}
}
}using IronZip;
class Program
{
static void Main()
{
// path to the ZIP file and extraction directory
string zipPath = "archive.zip";
string extractPath = "extracted/";
// Extract all files in the ZIP archive to the specified directory
using (var archive = new ZipArchive(zipPath))
{
archive.ExtractArchiveToDirectory(extractPath);
}
}
}Imports IronZip
Friend Class Program
Shared Sub Main()
' path to the ZIP file and extraction directory
Dim zipPath As String = "archive.zip"
Dim extractPath As String = "extracted/"
' Extract all files in the ZIP archive to the specified directory
Using archive = New ZipArchive(zipPath)
archive.ExtractArchiveToDirectory(extractPath)
End Using
End Sub
End ClassImports IronZip
Friend Class Program
Shared Sub Main()
' path to the ZIP file and extraction directory
Dim zipPath As String = "archive.zip"
Dim extractPath As String = "extracted/"
' Extract all files in the ZIP archive to the specified directory
Using archive = New ZipArchive(zipPath)
archive.ExtractArchiveToDirectory(extractPath)
End Using
End Sub
End ClassMevcut Arşive Dosya Ekleme
Yapıcıya ZIP dosya yolunu geçirmek ZIP dosyasını açacaktır. Aynı AddArchiveEntry metodunu kullanarak dosyaları açılan ZIP'e ekleyin ve SaveAs metoduyla dışa aktarın.
using IronZip;
using System.IO;
class Program
{
static void Main()
{
// Open an existing ZIP file
using (var archive = new ZipArchive("archive.zip"))
{
// Add more files to the archive
archive.AddArchiveEntry("anotherfile.txt", File.ReadAllBytes("path/to/anotherfile.txt"));
// Save updates to the ZIP archive
archive.SaveAs("archive.zip");
}
}
}using IronZip;
using System.IO;
class Program
{
static void Main()
{
// Open an existing ZIP file
using (var archive = new ZipArchive("archive.zip"))
{
// Add more files to the archive
archive.AddArchiveEntry("anotherfile.txt", File.ReadAllBytes("path/to/anotherfile.txt"));
// Save updates to the ZIP archive
archive.SaveAs("archive.zip");
}
}
}Imports IronZip
Imports System.IO
Friend Class Program
Shared Sub Main()
' Open an existing ZIP file
Using archive = New ZipArchive("archive.zip")
' Add more files to the archive
archive.AddArchiveEntry("anotherfile.txt", File.ReadAllBytes("path/to/anotherfile.txt"))
' Save updates to the ZIP archive
archive.SaveAs("archive.zip")
End Using
End Sub
End ClassImports IronZip
Imports System.IO
Friend Class Program
Shared Sub Main()
' Open an existing ZIP file
Using archive = New ZipArchive("archive.zip")
' Add more files to the archive
archive.AddArchiveEntry("anotherfile.txt", File.ReadAllBytes("path/to/anotherfile.txt"))
' Save updates to the ZIP archive
archive.SaveAs("archive.zip")
End Using
End Sub
End ClassLisanslama ve Destek Mevcuttur
IronZIP ücretli bir kütüphanedir; ancak, ücretsiz deneme lisansları da burada mevcuttur.
Iron Software hakkında daha fazla bilgi için lütfen web sitemizi ziyaret edin: https://ironsoftware.com/ Daha fazla destek ve sorularınız için lütfen ekibimize sorun.
Iron Software'dan Destek
Genel destek ve teknik sorular için lütfen şu adresten bize e-posta gönderin: support@ironsoftware.com
Curtis Chau, Bilgisayar Bilimleri alanında Lisans Derecesine (Carleton Üniversitesi) sahip ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirmeyle ilgileniyor. Sezgisel ve estetik açıdan hoş kullanıcı arayüzleri oluşturma tutkunu, Curtis modern çerçevelerle çalışmayı ve iyi yapılandırılmış, görsel olarak çekici kılavuzlar oluşturmayı seviyor.