概要
cscの作法、調べてみた。
sevenzipsharp.dll使ってみた。
解凍してみた。
参考にしたページ
サンプルコード
using System;
using System.IO;
using System.Windows.Forms;
using System.Drawing;
using SevenZip;
namespace seven
{
public class Form1 : Form {
public Button button1;
public Form1() {
Text = "7z";
button1 = new Button();
button1.Location = new System.Drawing.Point(50, 50);
button1.Size = new System.Drawing.Size(100, 30);
button1.Text = "test";
Controls.Add(button1);
button1.Click += new EventHandler(button1_Click);
}
private void button1_Click(object sender, EventArgs e) {
SevenZipBase.SetLibraryPath("7z.dll");
if (!Directory.Exists("decompress"))
Directory.CreateDirectory("decompress");
SevenZipExtractor extractor = new SevenZipExtractor("archive.7z");
extractor.ExtractArchive("decompress");
}
[STAThread]
static void Main() {
Application.Run(new Form1());
}
}
}
以上。