⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keypairgeneratorsettingsform.cs

📁 以MS .NET 所寫的RSA程式
💻 CS
字号:
// Copyright (c) Mathew John Schlabaugh. 2005.

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace RSACryptoPad
{
	public class keyPairGeneratorSettingsForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.RadioButton Bit1024RadioButton;
		private System.Windows.Forms.RadioButton Bit2048RadioButton;
		private System.Windows.Forms.Button generateKeysButton;
		private System.Windows.Forms.PictureBox keyPictureBox;
		private System.ComponentModel.Container components = null;

		public keyPairGeneratorSettingsForm()
		{InitializeComponent();}

		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if( components != null )
				{components.Dispose();}
			}
			base.Dispose( disposing );
		}

		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(keyPairGeneratorSettingsForm));
			this.generateKeysButton = new System.Windows.Forms.Button();
			this.Bit1024RadioButton = new System.Windows.Forms.RadioButton();
			this.Bit2048RadioButton = new System.Windows.Forms.RadioButton();
			this.keyPictureBox = new System.Windows.Forms.PictureBox();
			this.SuspendLayout();
			// 
			// generateKeysButton
			// 
			this.generateKeysButton.BackColor = System.Drawing.SystemColors.Control;
			this.generateKeysButton.Enabled = false;
			this.generateKeysButton.ForeColor = System.Drawing.SystemColors.ControlText;
			this.generateKeysButton.Location = new System.Drawing.Point(8, 96);
			this.generateKeysButton.Name = "generateKeysButton";
			this.generateKeysButton.Size = new System.Drawing.Size(176, 32);
			this.generateKeysButton.TabIndex = 0;
			this.generateKeysButton.Text = "Generate Keys";
			this.generateKeysButton.Click += new System.EventHandler(this.generateKeysButton_Click);
			// 
			// Bit1024RadioButton
			// 
			this.Bit1024RadioButton.Location = new System.Drawing.Point(16, 16);
			this.Bit1024RadioButton.Name = "Bit1024RadioButton";
			this.Bit1024RadioButton.TabIndex = 0;
			this.Bit1024RadioButton.Text = "1024 Bit";
			this.Bit1024RadioButton.Click += new System.EventHandler(this.Bit1024RadioButton_Click);
			// 
			// Bit2048RadioButton
			// 
			this.Bit2048RadioButton.Location = new System.Drawing.Point(16, 48);
			this.Bit2048RadioButton.Name = "Bit2048RadioButton";
			this.Bit2048RadioButton.TabIndex = 0;
			this.Bit2048RadioButton.Text = "2048 Bit";
			this.Bit2048RadioButton.Click += new System.EventHandler(this.Bit2048RadioButton_Click);
			// 
			// keyPictureBox
			// 
			this.keyPictureBox.BackColor = System.Drawing.Color.Black;
			this.keyPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.keyPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("keyPictureBox.Image")));
			this.keyPictureBox.Location = new System.Drawing.Point(120, 8);
			this.keyPictureBox.Name = "keyPictureBox";
			this.keyPictureBox.Size = new System.Drawing.Size(62, 71);
			this.keyPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
			this.keyPictureBox.TabIndex = 1;
			this.keyPictureBox.TabStop = false;
			// 
			// keyPairGeneratorSettingsForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(8, 19);
			this.BackColor = System.Drawing.Color.Black;
			this.ClientSize = new System.Drawing.Size(198, 140);
			this.Controls.Add(this.keyPictureBox);
			this.Controls.Add(this.Bit2048RadioButton);
			this.Controls.Add(this.Bit1024RadioButton);
			this.Controls.Add(this.generateKeysButton);
			this.Font = new System.Drawing.Font("Georgia", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.ForeColor = System.Drawing.Color.LightGreen;
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "keyPairGeneratorSettingsForm";
			this.ShowInTaskbar = false;
			this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "Key Size";
			this.Load += new System.EventHandler(this.keyPairGeneratorSettingsForm_Load);
			this.ResumeLayout(false);

		}

		private void keyPairGeneratorSettingsForm_Load(object sender, System.EventArgs e)
		{RSACryptoPad.mainForm.setBitStrength( 0 );}

		private void Bit1024RadioButton_Click(object sender, System.EventArgs e)
		{generateKeysButton.Enabled = true;}

		private void Bit2048RadioButton_Click(object sender, System.EventArgs e)
		{generateKeysButton.Enabled = true;}

		private void generateKeysButton_Click( object sender, System.EventArgs e )
		{
			if( Bit1024RadioButton.Checked == true )
			{RSACryptoPad.mainForm.setBitStrength( 1024 );}
			else if( Bit2048RadioButton.Checked == true )
			{RSACryptoPad.mainForm.setBitStrength( 2048 );}
			else {RSACryptoPad.mainForm.setBitStrength( 0 );}
			this.Dispose( true );
		}		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -