71 lines
1.8 KiB
C#
71 lines
1.8 KiB
C#
namespace AppView
|
|
{
|
|
public partial class FormMain : Form
|
|
{
|
|
public static int keySize = 50;
|
|
public FormMain()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
private void buttonFilePath_Click(object sender, EventArgs e)
|
|
{
|
|
using var dialog = new OpenFileDialog { };
|
|
if (dialog.ShowDialog() == DialogResult.OK)
|
|
{
|
|
textBoxFilePath.Text = dialog.FileName;
|
|
}
|
|
}
|
|
private void buttonSavepath_Click(object sender, EventArgs e)
|
|
{
|
|
using var dialog = new OpenFileDialog { };
|
|
if (dialog.ShowDialog() == DialogResult.OK)
|
|
{
|
|
textBoxSavePath.Text = dialog.FileName;
|
|
}
|
|
}
|
|
private void buttonKeyPath_Click(object sender, EventArgs e)
|
|
{
|
|
using var dialog = new OpenFileDialog { };
|
|
if (dialog.ShowDialog() == DialogResult.OK)
|
|
{
|
|
textBoxKeyPath.Text = dialog.FileName;
|
|
}
|
|
}
|
|
private void buttonFile2_Click(object sender, EventArgs e)
|
|
{
|
|
using var dialog = new OpenFileDialog { };
|
|
if (dialog.ShowDialog() == DialogResult.OK)
|
|
{
|
|
textBoxFile2.Text = dialog.FileName;
|
|
}
|
|
}
|
|
private void buttonCert2_Click(object sender, EventArgs e)
|
|
{
|
|
using var dialog = new OpenFileDialog { };
|
|
if (dialog.ShowDialog() == DialogResult.OK)
|
|
{
|
|
textBoxKey2.Text = dialog.FileName;
|
|
}
|
|
|
|
}
|
|
|
|
private void buttonWriteKey_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
if (Engine.WriteKeyOnFile(textBoxFilePath.Text, textBoxSavePath.Text, textBoxKeyPath.Text))
|
|
{
|
|
MessageBox.Show("Äîêóìåíò ïîäïèñàí");
|
|
}
|
|
else MessageBox.Show("Îøèáêà. Äîêóìåíò íå ïîäïèñàí");
|
|
}
|
|
private void buttonCheckKey_Click(object sender, EventArgs e)
|
|
{
|
|
if (Engine.CheckKeyinFIle(textBoxFile2.Text, textBoxKeyPath.Text, textBoxKey2.Text, textBoxPass.Text))
|
|
{
|
|
MessageBox.Show("Äîêóìåíòó ìîæíî âåðèòü");
|
|
}
|
|
else MessageBox.Show("Äîêóìåíòó íåëüçÿ âåðèòü");
|
|
}
|
|
|
|
}
|
|
} |