# IronZip'e Başlarken
## IronZIP: .NET için Hepsi Bir Arada Arşiv Kütüphanesi
**IronZIP**, Iron Software tarafından geliştirilen bir arşiv sıkıştırma ve açma kütüphanesiidir. Yaygın olarak kullanılan ZIP formatına ek olarak, TAR, GZIP ve BZIP2 formatlarını da destekler.
### C# Arşiv Sıkıştırma ve Açma Kütüphanesi
1. [Dosya sıkıştırma ve açma için C# kütüphanesini indirin](https://www.nuget.org/packages/IronZip/)
2. ZIP, TAR, GZIP ve BZIP2 formatlarını işleyin
3. Sıkıştırma seviyelerini 0 ile 9 arasında özelleştirin
4. Sıkıştırılmış arşivlerden içerik çıkarma
5. Dosyaları mevcut ZIP arşivlerine ekleyin ve yeni ZIP dosyaları oluşturun
### Uyumluluk
**IronZip,** aşağıdakilerle çapraz platform uyumluluğuna sahiptir:
#### .NET Sürümü Desteği:
- **C#**, **VB.NET**, **F#**
- **.NET 7, 6**, 5 ve .NET 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 ve WebForms)
- **Mobil** (Xamarin ve MAUI)
- **Masaüstü** (WPF ve MAUI)
- **Konsol** (Uygulama ve Kitaplık)
## Kurulum
### IronZIP kütüphanesi
IronZIP paketini yüklemek için terminalinizde veya paket yöneticisi konsolunuzda aşağıdaki komutu kullanın:
```shell
:ProductInstall
```
Alternatif olarak, [resmi IronZip NuGet web](https://www.nuget.org/packages/IronZip) sitesinden doğrudan indirebilirsiniz.
Yükleme tamamlandıktan sonra, C# kodunuzun başına `using IronZip;` ekleyerek kullanmaya başlayabilirsiniz.
## Lisans Anahtarını Uygulama
Ardından, lisans anahtarını License sınıfının LicenseKey özelliğine atayarak IronZIP'e geçerli bir lisans veya deneme anahtarı uygulayın. Herhangi bir IronZIP yöntemini kullanmadan önce, import ifadesinin hemen arkasına aşağıdaki kodu ekleyin:
```csharp
using IronZip;
// Apply your license key here
IronZip.License.LicenseKey = "YOUR_LICENSE_KEY";
```
## Kod Örnekleri
### Arşiv Örneği Oluştur
`using` deyimini kullanarak bir ZIP dosyası oluşturun. using bloğu içinde, dosyaları ZIP dosyasına aktarmak için `AddArchiveEntry` yöntemini kullanın. Son olarak, ZIP dosyasını `SaveAs` yöntemiyle dışa aktarın.
```csharp
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");
}
}
}
```
### Arşivi Klasöre Çıkar
`ExtractArchiveToDirectory` yöntemini kullanarak ZIP dosyasından içeriği çıkarın. Hedef ZIP dosyasının yolunu ve çıkarma dizinini belirtin.
```csharp
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);
}
}
}
```
### Mevcut Bir Arşive Dosya Ekleme
ZIP dosyasının yolunu yapıcıya aktararak ZIP dosyasını açabilirsiniz. Aynı `AddArchiveEntry` yöntemini kullanarak açılan ZIP dosyasına dosya ekleyebilir ve `SaveAs` yöntemiyle dışa aktarabilirsiniz.
```csharp
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");
}
}
}
```
## Lisanslama ve Destek
**IronZIP** ücretli bir kütüphanedir; Ancak, Ücretsiz Deneme Lisansları da [burada](trial-license) mevcuttur.
Iron Software hakkında daha fazla bilgi için lütfen web sitemizi ziyaret edin: [https://ironsoftware.com/](https://ironsoftware.com/)
Daha fazla destek ve sorularınız için lütfen [ekibimize danışın](#live-chat-support).
### Iron Software'den destek
Genel destek ve teknik sorularınız için lütfen bize e-posta gönderin: [support@ironsoftware.com](mailto:support@ironsoftware.com)
IronZIP: .NET için Hepsi Bir Arada Arşiv Kütüphanesi
IronZIP, Iron Software tarafından geliştirilen bir arşiv sıkıştırma ve açma kütüphanesiidir. Yaygın olarak kullanılan ZIP formatına ek olarak, TAR, GZIP ve BZIP2 formatlarını da destekler.
Yükleme tamamlandıktan sonra, C# kodunuzun başına using IronZip; ekleyerek kullanmaya başlayabilirsiniz.
Lisans Anahtarını Uygulama
Ardından, lisans anahtarını License sınıfının LicenseKey özelliğine atayarak IronZIP'e geçerli bir lisans veya deneme anahtarı uygulayın. Herhangi bir IronZIP yöntemini kullanmadan önce, import ifadesinin hemen arkasına aşağıdaki kodu ekleyin:
using IronZip;// Apply your license key hereIronZip.License.LicenseKey = "YOUR_LICENSE_KEY";
using IronZip;
// Apply your license key here
IronZip.License.LicenseKey = "YOUR_LICENSE_KEY";
ImportsIronZip' Apply your license key hereIronZip.License.LicenseKey = "YOUR_LICENSE_KEY"
Imports IronZip
' Apply your license key here
IronZip.License.LicenseKey = "YOUR_LICENSE_KEY"
Kod Örnekleri
Arşiv Örneği Oluştur
using deyimini kullanarak bir ZIP dosyası oluşturun. using bloğu içinde, dosyaları ZIP dosyasına aktarmak için AddArchiveEntry yöntemini kullanın. Son olarak, ZIP dosyasını SaveAs yöntemiyle dışa aktarın.
using IronZip;using System.IO;class Program{ static voidMain() { // 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");
}
}
}
ImportsIronZipImportsSystem.IOFriend Class ProgramShared Sub Main() ' Create a new ZIP fileUsing 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")EndUsing End SubEnd Class
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 Class
Arşivi Klasöre Çıkar
ExtractArchiveToDirectory yöntemini kullanarak ZIP dosyasından içeriği çıkarın. Hedef ZIP dosyasının yolunu ve çıkarma dizinini belirtin.
using IronZip;class Program{ static voidMain() { // 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);
}
}
}
ImportsIronZipFriend Class ProgramShared Sub Main() ' path to the ZIP file and extraction directory Dim zipPath AsString = "archive.zip" Dim extractPath AsString = "extracted/" ' Extract all files in the ZIP archive to the specified directoryUsing archive = New ZipArchive(zipPath) archive.ExtractArchiveToDirectory(extractPath)EndUsing End SubEnd Class
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 Class
Mevcut Bir Arşive Dosya Ekleme
ZIP dosyasının yolunu yapıcıya aktararak ZIP dosyasını açabilirsiniz. Aynı AddArchiveEntry yöntemini kullanarak açılan ZIP dosyasına dosya ekleyebilir ve SaveAs yöntemiyle dışa aktarabilirsiniz.
using IronZip;using System.IO;class Program{ static voidMain() { // 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");
}
}
}
ImportsIronZipImportsSystem.IOFriend Class ProgramShared Sub Main() ' Open an existing ZIP fileUsing 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")EndUsing End SubEnd Class
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 Class
Lisanslama ve Destek
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 danışın.
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.