-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmMultiCriptASCII.cs
88 lines (80 loc) · 2.68 KB
/
frmMultiCriptASCII.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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;
namespace Encript_Master_v2._0
{
public partial class frmMultiCriptASCII : Form
{
ASCII ASCII;
public frmMultiCriptASCII()
{
InitializeComponent();
}
string Titulo = "Encryption Master v2.0 Criptografia Múltipla (ASCII)";
private void Animacao()
{
wmpPrincipal.Ctlcontrols.play();
}
private void frmMultiCriptASCII_Load(object sender, EventArgs e)
{
Animacao();
}
private void btnClear_Click(object sender, EventArgs e)
{
this.Text = Titulo + " (Limpando)";
txtPrincipal.Clear();
this.Text = Titulo;
Animacao();
}
private void btnCriptASCII_Click(object sender, EventArgs e)
{
for (int i = 0; i < nupCriptValue.Value; i++)
{
try
{
ASCII = new ASCII();
txtPrincipal.Text = ASCII.Criptografar(txtPrincipal.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Erro na " + i + "º tentativa!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void btnDescriptASCII_Click(object sender, EventArgs e)
{
for (int i = 0; i < nupCriptValue.Value; i++)
{
try
{
ASCII = new ASCII();
txtPrincipal.Text = ASCII.Descriptografar(txtPrincipal.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Erro na " + i + "º tentativa!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void nupFontValue_ValueChanged(object sender, EventArgs e)
{
try
{
this.Text = Titulo + " (Aumentando Fonte)";
float tamanhofonte = (Convert.ToInt32(nupFontValue.Value));
this.txtPrincipal.Font = new Font("Consolas", tamanhofonte, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
this.Text = Titulo;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}