LoginSignup
0
0

More than 1 year has passed since last update.

cscの作法 その156

Posted at

概要

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());
		}
	}
}




以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0