📄 gui.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
namespace Encrypt
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.RadioButton plainButton;
private System.Windows.Forms.RadioButton cipherButton;
private System.Windows.Forms.Button Quit;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Button decryptbutton;
private System.Windows.Forms.Button encryptbutton;
private System.Windows.Forms.TextBox ciphertext;
private System.Windows.Forms.TextBox plaintext;
private System.Windows.Forms.Button Clear;
private const string FILE_NAME = "ErrorLog.txt";
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.TextBox IncValue;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.ToolTip toolTip2;
private System.Windows.Forms.ToolTip toolTip3;
private System.Windows.Forms.ToolTip toolTip4;
private System.Windows.Forms.ToolTip toolTip5;
private System.Windows.Forms.ToolTip toolTip6;
private System.ComponentModel.IContainer components;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.IncValue = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.Clear = new System.Windows.Forms.Button();
this.encryptbutton = new System.Windows.Forms.Button();
this.decryptbutton = new System.Windows.Forms.Button();
this.Quit = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.ciphertext = new System.Windows.Forms.TextBox();
this.plaintext = new System.Windows.Forms.TextBox();
this.plainButton = new System.Windows.Forms.RadioButton();
this.cipherButton = new System.Windows.Forms.RadioButton();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.toolTip2 = new System.Windows.Forms.ToolTip(this.components);
this.toolTip3 = new System.Windows.Forms.ToolTip(this.components);
this.toolTip4 = new System.Windows.Forms.ToolTip(this.components);
this.toolTip5 = new System.Windows.Forms.ToolTip(this.components);
this.toolTip6 = new System.Windows.Forms.ToolTip(this.components);
this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.groupBox4,
this.groupBox3,
this.groupBox2});
this.groupBox1.Location = new System.Drawing.Point(8, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(360, 136);
this.groupBox1.TabIndex = 8;
this.groupBox1.TabStop = false;
//
// groupBox4
//
this.groupBox4.Controls.AddRange(new System.Windows.Forms.Control[] {
this.IncValue,
this.label1});
this.groupBox4.Location = new System.Drawing.Point(8, 88);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(232, 40);
this.groupBox4.TabIndex = 21;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Value";
//
// IncValue
//
this.IncValue.Location = new System.Drawing.Point(192, 16);
this.IncValue.MaxLength = 10;
this.IncValue.Name = "IncValue";
this.IncValue.Size = new System.Drawing.Size(24, 20);
this.IncValue.TabIndex = 3;
this.IncValue.Text = "";
this.IncValue.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.IncValue_KeyPress);
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(192, 16);
this.label1.TabIndex = 24;
this.label1.Text = "Please enter the value to encrypt by:";
//
// groupBox3
//
this.groupBox3.Controls.AddRange(new System.Windows.Forms.Control[] {
this.Clear,
this.encryptbutton,
this.decryptbutton,
this.Quit});
this.groupBox3.Location = new System.Drawing.Point(248, 8);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(104, 120);
this.groupBox3.TabIndex = 20;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Options";
//
// Clear
//
this.Clear.Location = new System.Drawing.Point(16, 64);
this.Clear.Name = "Clear";
this.Clear.Size = new System.Drawing.Size(75, 20);
this.Clear.TabIndex = 8;
this.Clear.Text = "&Clear";
this.Clear.Click += new System.EventHandler(this.Clear_Click);
this.Clear.MouseHover += new System.EventHandler(this.Clear_MouseHover);
//
// encryptbutton
//
this.encryptbutton.Location = new System.Drawing.Point(16, 16);
this.encryptbutton.Name = "encryptbutton";
this.encryptbutton.Size = new System.Drawing.Size(75, 20);
this.encryptbutton.TabIndex = 4;
this.encryptbutton.Text = "&Encrypt";
this.encryptbutton.Click += new System.EventHandler(this.encryptbutton_Click);
this.encryptbutton.MouseHover += new System.EventHandler(this.encryptbutton_MouseHover);
//
// decryptbutton
//
this.decryptbutton.Location = new System.Drawing.Point(16, 40);
this.decryptbutton.Name = "decryptbutton";
this.decryptbutton.Size = new System.Drawing.Size(75, 20);
this.decryptbutton.TabIndex = 7;
this.decryptbutton.Text = "&Decrypt";
this.decryptbutton.Click += new System.EventHandler(this.decryptbutton_Click);
this.decryptbutton.MouseHover += new System.EventHandler(this.decryptbutton_MouseHover);
//
// Quit
//
this.Quit.Location = new System.Drawing.Point(16, 88);
this.Quit.Name = "Quit";
this.Quit.Size = new System.Drawing.Size(75, 20);
this.Quit.TabIndex = 9;
this.Quit.Text = "&Quit";
this.Quit.Click += new System.EventHandler(this.Quit_Click);
this.Quit.MouseHover += new System.EventHandler(this.Quit_MouseHover);
//
// groupBox2
//
this.groupBox2.Controls.AddRange(new System.Windows.Forms.Control[] {
this.ciphertext,
this.plaintext,
this.plainButton,
this.cipherButton});
this.groupBox2.Location = new System.Drawing.Point(8, 8);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(232, 80);
this.groupBox2.TabIndex = 16;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Text Options";
//
// ciphertext
//
this.ciphertext.Location = new System.Drawing.Point(120, 48);
this.ciphertext.Name = "ciphertext";
this.ciphertext.Size = new System.Drawing.Size(104, 20);
this.ciphertext.TabIndex = 6;
this.ciphertext.Text = "";
this.ciphertext.MouseHover += new System.EventHandler(this.ciphertext_MouseHover);
//
// plaintext
//
this.plaintext.Location = new System.Drawing.Point(120, 16);
this.plaintext.Name = "plaintext";
this.plaintext.Size = new System.Drawing.Size(104, 20);
this.plaintext.TabIndex = 2;
this.plaintext.Text = "";
this.plaintext.MouseHover += new System.EventHandler(this.plaintext_MouseHover);
//
// plainButton
//
this.plainButton.Checked = true;
this.plainButton.Location = new System.Drawing.Point(16, 16);
this.plainButton.Name = "plainButton";
this.plainButton.Size = new System.Drawing.Size(80, 24);
this.plainButton.TabIndex = 1;
this.plainButton.TabStop = true;
this.plainButton.Text = "PlainText";
this.plainButton.CheckedChanged += new System.EventHandler(this.plainButton_CheckedChanged);
//
// cipherButton
//
this.cipherButton.Location = new System.Drawing.Point(16, 48);
this.cipherButton.Name = "cipherButton";
this.cipherButton.Size = new System.Drawing.Size(88, 24);
this.cipherButton.TabIndex = 5;
this.cipherButton.TabStop = true;
this.cipherButton.Text = "CipherText";
this.cipherButton.CheckedChanged += new System.EventHandler(this.cipherButton_CheckedChanged);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(376, 142);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.groupBox1});
this.Location = new System.Drawing.Point(120, 48);
this.MaximizeBox = false;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Encryption / Decryption Program";
this.TransparencyKey = System.Drawing.Color.Transparent;
this.Load += new System.EventHandler(this.Form1_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -