-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
46 lines (40 loc) · 1.27 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.Diagnostics;
namespace Gui7Z
{
public partial class Form1 : Form
{
string loc;
string dest;
public Form1()
{
InitializeComponent();
}
private void openFileDialog1_FileOk(object sender, System.ComponentModel.CancelEventArgs e)
{
loc = openFileDialog1.FileName;
label1.Text = loc;
textBox1.Text = null;
}
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
openFileDialog1.ReadOnlyChecked = true;
openFileDialog1.SelectReadOnly = true;
}
private void button2_Click(object sender, EventArgs e)
{
DialogResult result = folderBrowserDialog1.ShowDialog();
if (result == DialogResult.OK)
{
label2.Text = folderBrowserDialog1.SelectedPath;
dest = folderBrowserDialog1.SelectedPath;
}
}
private void button3_Click(object sender, EventArgs e)
{
Process.Start("cmd.exe", "/c 7z.exe x " + loc + " -p" + textBox1.Text + " -o" + dest + "> zip.log");
Thread.Sleep(1500);
Process.Start("explorer.exe", dest);
}
}
}