.NET Framework 4.5 以降では.NET Framework の標準ライブラリのZipArchiveクラスを利用して展開処理を実装できます。詳細はこちらの記事を参照してください。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using Ionic.Zip;
namespace ZipExtract
{
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
MemoryStream ms = new MemoryStream();
StreamWriter sw = new StreamWriter(ms);
ReadOptions options = new ReadOptions();
options.StatusMessageWriter = sw;
ZipFile zf = ZipFile.Read(openFileDialog1.FileName, options);
string extractPath = Path.GetDirectoryName(openFileDialog1.FileName)
+ "\\" +Path.GetFileNameWithoutExtension(openFileDialog1.FileName);
zf.ExtractAll(extractPath);
ms.Seek(0, 0);
StreamReader sr = new StreamReader(ms);
string msg = sr.ReadToEnd();
textBox1.Text += msg +"\r\n";
textBox1.Text += "処理が終了しました。\r\n";
}
}
}
}