📄 mainform.cs
字号:
// Copyright (c) Mathew John Schlabaugh. 2005.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Security.Cryptography;
namespace RSACryptoPad
{
public class mainForm : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu;
private System.Windows.Forms.MenuItem fileMenuItem;
private System.Windows.Forms.MenuItem newFileMenuItem;
private System.Windows.Forms.MenuItem openFileMenuItem;
private System.Windows.Forms.MenuItem saveAsFileMenuItem;
private System.Windows.Forms.MenuItem separator1;
private System.Windows.Forms.MenuItem exitMenuItem;
private System.Windows.Forms.MenuItem cutMenuItem;
private System.Windows.Forms.MenuItem copyMenuItem;
private System.Windows.Forms.MenuItem pasteMenuItem;
private System.Windows.Forms.MenuItem deleteMenuItem;
private System.Windows.Forms.MenuItem separator2;
private System.Windows.Forms.MenuItem selectAllmenuItem;
private System.Windows.Forms.MenuItem formatMenuItem;
private System.Windows.Forms.MenuItem wordWrapMenuItem;
private System.Windows.Forms.MenuItem fontMenuItem;
private System.Windows.Forms.MenuItem editMenuItem;
private System.Windows.Forms.MenuItem encryptionMenuItem;
private System.Windows.Forms.MenuItem encryptMenuItem;
private System.Windows.Forms.MenuItem decryptMenuItem;
private System.Windows.Forms.MenuItem generateKeyPairMenuItem;
private System.Windows.Forms.MenuItem helpMenuItem;
private System.Windows.Forms.MenuItem helpTopicsMenuItem;
private System.Windows.Forms.MenuItem separator3;
private System.Windows.Forms.MenuItem aboutMenuItem;
private System.Windows.Forms.FontDialog fontDialog;
private System.Windows.Forms.OpenFileDialog openFileDialog;
private System.Windows.Forms.SaveFileDialog saveFileDialog;
private System.Windows.Forms.TextBox inputTextBox;
private System.Windows.Forms.Panel panel;
private System.Windows.Forms.PictureBox pictureBox;
private System.Windows.Forms.Label processingLabel;
private System.ComponentModel.Container components = null;
private System.Boolean originalText = true;
public static System.Int32 currentBitStrength = 0;
public mainForm()
{InitializeComponent();}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if( components != null )
{components.Dispose();}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(mainForm));
this.mainMenu = new System.Windows.Forms.MainMenu();
this.fileMenuItem = new System.Windows.Forms.MenuItem();
this.newFileMenuItem = new System.Windows.Forms.MenuItem();
this.openFileMenuItem = new System.Windows.Forms.MenuItem();
this.saveAsFileMenuItem = new System.Windows.Forms.MenuItem();
this.separator1 = new System.Windows.Forms.MenuItem();
this.exitMenuItem = new System.Windows.Forms.MenuItem();
this.editMenuItem = new System.Windows.Forms.MenuItem();
this.cutMenuItem = new System.Windows.Forms.MenuItem();
this.copyMenuItem = new System.Windows.Forms.MenuItem();
this.pasteMenuItem = new System.Windows.Forms.MenuItem();
this.deleteMenuItem = new System.Windows.Forms.MenuItem();
this.separator2 = new System.Windows.Forms.MenuItem();
this.selectAllmenuItem = new System.Windows.Forms.MenuItem();
this.formatMenuItem = new System.Windows.Forms.MenuItem();
this.wordWrapMenuItem = new System.Windows.Forms.MenuItem();
this.fontMenuItem = new System.Windows.Forms.MenuItem();
this.encryptionMenuItem = new System.Windows.Forms.MenuItem();
this.encryptMenuItem = new System.Windows.Forms.MenuItem();
this.decryptMenuItem = new System.Windows.Forms.MenuItem();
this.generateKeyPairMenuItem = new System.Windows.Forms.MenuItem();
this.helpMenuItem = new System.Windows.Forms.MenuItem();
this.helpTopicsMenuItem = new System.Windows.Forms.MenuItem();
this.separator3 = new System.Windows.Forms.MenuItem();
this.aboutMenuItem = new System.Windows.Forms.MenuItem();
this.inputTextBox = new System.Windows.Forms.TextBox();
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
this.fontDialog = new System.Windows.Forms.FontDialog();
this.panel = new System.Windows.Forms.Panel();
this.processingLabel = new System.Windows.Forms.Label();
this.pictureBox = new System.Windows.Forms.PictureBox();
this.panel.SuspendLayout();
this.SuspendLayout();
//
// mainMenu
//
this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.fileMenuItem,
this.editMenuItem,
this.formatMenuItem,
this.encryptionMenuItem,
this.helpMenuItem});
//
// fileMenuItem
//
this.fileMenuItem.Index = 0;
this.fileMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.newFileMenuItem,
this.openFileMenuItem,
this.saveAsFileMenuItem,
this.separator1,
this.exitMenuItem});
this.fileMenuItem.Text = "File";
//
// newFileMenuItem
//
this.newFileMenuItem.Index = 0;
this.newFileMenuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlN;
this.newFileMenuItem.Text = "New";
this.newFileMenuItem.Click += new System.EventHandler(this.newFileMenuItem_Click);
//
// openFileMenuItem
//
this.openFileMenuItem.Index = 1;
this.openFileMenuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlO;
this.openFileMenuItem.Text = "Open...";
this.openFileMenuItem.Click += new System.EventHandler(this.openFileMenuItem_Click);
//
// saveAsFileMenuItem
//
this.saveAsFileMenuItem.Index = 2;
this.saveAsFileMenuItem.Text = "Save As... ";
this.saveAsFileMenuItem.Click += new System.EventHandler(this.saveAsFileMenuItem_Click);
//
// separator1
//
this.separator1.Index = 3;
this.separator1.Text = "-";
//
// exitMenuItem
//
this.exitMenuItem.Index = 4;
this.exitMenuItem.Text = "Exit ";
this.exitMenuItem.Click += new System.EventHandler(this.exitMenuItem_Click);
//
// editMenuItem
//
this.editMenuItem.Index = 1;
this.editMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.cutMenuItem,
this.copyMenuItem,
this.pasteMenuItem,
this.deleteMenuItem,
this.separator2,
this.selectAllmenuItem});
this.editMenuItem.Text = "Edit";
//
// cutMenuItem
//
this.cutMenuItem.Index = 0;
this.cutMenuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlX;
this.cutMenuItem.Text = "Cut";
this.cutMenuItem.Click += new System.EventHandler(this.cutMenuItem_Click);
//
// copyMenuItem
//
this.copyMenuItem.Index = 1;
this.copyMenuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlC;
this.copyMenuItem.Text = "Copy";
this.copyMenuItem.Click += new System.EventHandler(this.copyMenuItem_Click);
//
// pasteMenuItem
//
this.pasteMenuItem.Index = 2;
this.pasteMenuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlV;
this.pasteMenuItem.Text = "Paste";
this.pasteMenuItem.Click += new System.EventHandler(this.pasteMenuItem_Click);
//
// deleteMenuItem
//
this.deleteMenuItem.Index = 3;
this.deleteMenuItem.Shortcut = System.Windows.Forms.Shortcut.Del;
this.deleteMenuItem.Text = "Delete";
this.deleteMenuItem.Click += new System.EventHandler(this.deleteMenuItem_Click);
//
// separator2
//
this.separator2.Index = 4;
this.separator2.Text = "-";
//
// selectAllmenuItem
//
this.selectAllmenuItem.Index = 5;
this.selectAllmenuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlA;
this.selectAllmenuItem.Text = "Select All";
this.selectAllmenuItem.Click += new System.EventHandler(this.selectAllmenuItem_Click);
//
// formatMenuItem
//
this.formatMenuItem.Index = 2;
this.formatMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.wordWrapMenuItem,
this.fontMenuItem});
this.formatMenuItem.Text = "Format";
//
// wordWrapMenuItem
//
this.wordWrapMenuItem.Checked = true;
this.wordWrapMenuItem.Index = 0;
this.wordWrapMenuItem.RadioCheck = true;
this.wordWrapMenuItem.Text = "Word Wrap";
this.wordWrapMenuItem.Click += new System.EventHandler(this.wordWrapMenuItem_Click);
//
// fontMenuItem
//
this.fontMenuItem.Index = 1;
this.fontMenuItem.Text = "Font...";
this.fontMenuItem.Click += new System.EventHandler(this.fontMenuItem_Click);
//
// encryptionMenuItem
//
this.encryptionMenuItem.Index = 3;
this.encryptionMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.encryptMenuItem,
this.decryptMenuItem,
this.generateKeyPairMenuItem});
this.encryptionMenuItem.Text = "Encryption";
//
// encryptMenuItem
//
this.encryptMenuItem.Index = 0;
this.encryptMenuItem.Text = "Encrypt...";
this.encryptMenuItem.Click += new System.EventHandler(this.encryptMenuItem_Click);
//
// decryptMenuItem
//
this.decryptMenuItem.Index = 1;
this.decryptMenuItem.Text = "Decrypt...";
this.decryptMenuItem.Click += new System.EventHandler(this.decryptMenuItem_Click);
//
// generateKeyPairMenuItem
//
this.generateKeyPairMenuItem.Index = 2;
this.generateKeyPairMenuItem.Text = "Generate Key Pair...";
this.generateKeyPairMenuItem.Click += new System.EventHandler(this.generateKeyPairMenuItem_Click);
//
// helpMenuItem
//
this.helpMenuItem.Index = 4;
this.helpMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.helpTopicsMenuItem,
this.separator3,
this.aboutMenuItem});
this.helpMenuItem.Text = "Help";
//
// helpTopicsMenuItem
//
this.helpTopicsMenuItem.Index = 0;
this.helpTopicsMenuItem.Text = "Help Topics";
this.helpTopicsMenuItem.Click += new System.EventHandler(this.helpTopicsMenuItem_Click);
//
// separator3
//
this.separator3.Index = 1;
this.separator3.Text = "-";
//
// aboutMenuItem
//
this.aboutMenuItem.Index = 2;
this.aboutMenuItem.Text = "About RSACryptoPad";
this.aboutMenuItem.Click += new System.EventHandler(this.aboutMenuItem_Click);
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -