📄 form3.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace client
{
//Form3 的说明.
public class Form3 : System.Windows.Forms.Form
{
//恢复注册表的控制信息变量.
public string RollbackSingal;
//"选项"的组件集.
private System.Windows.Forms.GroupBox groupBox1;
//4个CheckBox控件,包括恢复注销,恢复关机,显示硬盘,显示桌面.
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.CheckBox checkBox2;
private System.Windows.Forms.CheckBox checkBox3;
private System.Windows.Forms.CheckBox checkBox4;
//2个Button控件,确定与关闭.
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form3()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button2 = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.checkBox3 = new System.Windows.Forms.CheckBox();
this.checkBox4 = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// button2
//
this.button2.Location = new System.Drawing.Point(160, 160);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 9;
this.button2.Text = "关闭";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.checkBox1);
this.groupBox1.Controls.Add(this.checkBox2);
this.groupBox1.Controls.Add(this.checkBox3);
this.groupBox1.Controls.Add(this.checkBox4);
this.groupBox1.Location = new System.Drawing.Point(46, 16);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(200, 128);
this.groupBox1.TabIndex = 7;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "选项";
//
// checkBox1
//
this.checkBox1.Location = new System.Drawing.Point(40, 24);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(104, 24);
this.checkBox1.TabIndex = 0;
this.checkBox1.Text = "恢复注销";
//
// checkBox2
//
this.checkBox2.Location = new System.Drawing.Point(40, 48);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(104, 24);
this.checkBox2.TabIndex = 1;
this.checkBox2.Text = "恢复关机";
//
// checkBox3
//
this.checkBox3.Location = new System.Drawing.Point(40, 72);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(104, 24);
this.checkBox3.TabIndex = 2;
this.checkBox3.Text = "显示硬盘";
//
// checkBox4
//
this.checkBox4.Location = new System.Drawing.Point(40, 96);
this.checkBox4.Name = "checkBox4";
this.checkBox4.Size = new System.Drawing.Size(128, 24);
this.checkBox4.TabIndex = 3;
this.checkBox4.Text = "显示桌面";
//
// button1
//
this.button1.Location = new System.Drawing.Point(64, 160);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 8;
this.button1.Text = "确定";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form3
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 197);
this.Controls.Add(this.button2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.button1);
this.Name = "Form3";
this.Text = "恢复选项";
this.Load += new System.EventHandler(this.Form3_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
//生成恢复注册表的控制信息码.
private void button1_Click(object sender, System.EventArgs e)
{
if (checkBox1.Checked)
{
RollbackSingal = "rs1000";
}
if (checkBox2.Checked)
{
RollbackSingal = "rs0100";
}
if (checkBox3.Checked)
{
RollbackSingal = "rs0010";
}
if (checkBox4.Checked)
{
RollbackSingal = "rs0001";
}
if (checkBox1.Checked && checkBox2.Checked)
{
RollbackSingal = "rs1100";
}
if (checkBox1.Checked && checkBox3.Checked)
{
RollbackSingal = "rs1010";
}
if (checkBox1.Checked && checkBox4.Checked)
{
RollbackSingal = "rs1001";
}
if (checkBox2.Checked && checkBox3.Checked)
{
RollbackSingal = "rs0110";
}
if (checkBox2.Checked && checkBox4.Checked)
{
RollbackSingal = "rs0101";
}
if (checkBox3.Checked && checkBox4.Checked)
{
RollbackSingal = "rs0011";
}
if (checkBox1.Checked && checkBox2.Checked && checkBox3.Checked)
{
RollbackSingal = "rs1110";
}
if (checkBox1.Checked && checkBox2.Checked && checkBox4.Checked)
{
RollbackSingal = "rs1101";
}
if (checkBox1.Checked && checkBox4.Checked && checkBox3.Checked)
{
RollbackSingal = "rs1011";
}
if (checkBox2.Checked && checkBox3.Checked && checkBox4.Checked)
{
RollbackSingal = "rs0111";
}
if (checkBox1.Checked && checkBox2.Checked && checkBox3.Checked && checkBox4.Checked)
{
RollbackSingal = "rs1111";
}
Close();
}
//关闭该窗口.
private void button2_Click(object sender, System.EventArgs e)
{
Close();
}
private void Form3_Load(object sender, EventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -