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

📄 formmain.cs

📁 C#开发的驱动备份程序供大家参考 C#开发的驱动备份程序供大家参考
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Microsoft.Win32;
using System.IO;

namespace DriverBackup
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class FormMain : System.Windows.Forms.Form
	{
    private System.Windows.Forms.ListView DriverListView;
    private System.Windows.Forms.ColumnHeader columnHeader1;
    private System.Windows.Forms.ColumnHeader columnHeader2;
    private System.Windows.Forms.ColumnHeader columnHeader3;
    private System.Windows.Forms.MainMenu mainMenu;
    private System.Windows.Forms.MenuItem miDrivers;
    private System.Windows.Forms.MenuItem miScan;
    private System.Windows.Forms.MenuItem miScanAll;
    private System.Windows.Forms.MenuItem menuItem4;
    private System.Windows.Forms.MenuItem miBackup;
    private System.Windows.Forms.MenuItem miBackSel;
    private System.Windows.Forms.MenuItem menuItem2;
    private System.Windows.Forms.MenuItem miBackDef;
    private System.Windows.Forms.MenuItem miBackAll;
    private System.Windows.Forms.MenuItem miExit;
    private System.Windows.Forms.GroupBox groupBox1;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.Label label4;
    private System.Windows.Forms.Label label5;
    private System.Windows.Forms.Label label6;
    private System.Windows.Forms.StatusBar statusBar1;
    private System.Windows.Forms.ContextMenu contextMenu1;
    private System.Windows.Forms.MenuItem menuItem1;
    private System.Windows.Forms.MenuItem menuItem3;
    private System.Windows.Forms.MenuItem menuItem5;
    private System.Windows.Forms.MenuItem menuItem6;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public FormMain()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
      this.DriverListView = new System.Windows.Forms.ListView();
      this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
      this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
      this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
      this.mainMenu = new System.Windows.Forms.MainMenu();
      this.miDrivers = new System.Windows.Forms.MenuItem();
      this.miScan = new System.Windows.Forms.MenuItem();
      this.miScanAll = new System.Windows.Forms.MenuItem();
      this.menuItem4 = new System.Windows.Forms.MenuItem();
      this.miExit = new System.Windows.Forms.MenuItem();
      this.miBackup = new System.Windows.Forms.MenuItem();
      this.miBackSel = new System.Windows.Forms.MenuItem();
      this.menuItem2 = new System.Windows.Forms.MenuItem();
      this.miBackDef = new System.Windows.Forms.MenuItem();
      this.miBackAll = new System.Windows.Forms.MenuItem();
      this.groupBox1 = new System.Windows.Forms.GroupBox();
      this.label6 = new System.Windows.Forms.Label();
      this.label5 = new System.Windows.Forms.Label();
      this.label4 = new System.Windows.Forms.Label();
      this.label3 = new System.Windows.Forms.Label();
      this.label2 = new System.Windows.Forms.Label();
      this.label1 = new System.Windows.Forms.Label();
      this.statusBar1 = new System.Windows.Forms.StatusBar();
      this.contextMenu1 = new System.Windows.Forms.ContextMenu();
      this.menuItem1 = new System.Windows.Forms.MenuItem();
      this.menuItem3 = new System.Windows.Forms.MenuItem();
      this.menuItem5 = new System.Windows.Forms.MenuItem();
      this.menuItem6 = new System.Windows.Forms.MenuItem();
      this.groupBox1.SuspendLayout();
      this.SuspendLayout();
      // 
      // DriverListView
      // 
      this.DriverListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
        | System.Windows.Forms.AnchorStyles.Left) 
        | System.Windows.Forms.AnchorStyles.Right)));
      this.DriverListView.CheckBoxes = true;
      this.DriverListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
                                                                                     this.columnHeader1,
                                                                                     this.columnHeader2,
                                                                                     this.columnHeader3});
      this.DriverListView.ContextMenu = this.contextMenu1;
      this.DriverListView.FullRowSelect = true;
      this.DriverListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
      this.DriverListView.Location = new System.Drawing.Point(4, 4);
      this.DriverListView.Name = "DriverListView";
      this.DriverListView.Size = new System.Drawing.Size(560, 192);
      this.DriverListView.TabIndex = 0;
      this.DriverListView.View = System.Windows.Forms.View.Details;
      this.DriverListView.SelectedIndexChanged += new System.EventHandler(this.DriverListView_SelectedIndexChanged);
      // 
      // columnHeader1
      // 
      this.columnHeader1.Text = "驱动设备名称";
      this.columnHeader1.Width = 320;
      // 
      // columnHeader2
      // 
      this.columnHeader2.Text = "驱动类型";
      this.columnHeader2.Width = 150;
      // 
      // columnHeader3
      // 
      this.columnHeader3.Text = "备注";
      // 
      // mainMenu
      // 
      this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                             this.miDrivers,
                                                                             this.miBackup,
                                                                             this.menuItem5});
      // 
      // miDrivers
      // 
      this.miDrivers.Index = 0;
      this.miDrivers.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                              this.miScan,
                                                                              this.miScanAll,
                                                                              this.menuItem4,
                                                                              this.miExit});
      this.miDrivers.Text = "设备(&S)";
      // 
      // miScan
      // 
      this.miScan.Index = 0;
      this.miScan.Text = "搜索厂商驱动(&S)";
      this.miScan.Click += new System.EventHandler(this.miScan_Click);
      // 
      // miScanAll
      // 
      this.miScanAll.Index = 1;
      this.miScanAll.Text = "搜索所有驱动(&A)";
      this.miScanAll.Click += new System.EventHandler(this.miScanAll_Click);
      // 
      // menuItem4
      // 
      this.menuItem4.Index = 2;
      this.menuItem4.Text = "-";
      // 
      // miExit
      // 
      this.miExit.Index = 3;
      this.miExit.Text = "退出(&X)";
      this.miExit.Click += new System.EventHandler(this.miExit_Click);
      // 
      // miBackup
      // 
      this.miBackup.Index = 1;
      this.miBackup.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                             this.miBackSel,
                                                                             this.menuItem2,
                                                                             this.miBackDef,
                                                                             this.miBackAll});
      this.miBackup.Text = "备份(&B)";
      // 
      // miBackSel
      // 
      this.miBackSel.Index = 0;
      this.miBackSel.Text = "备份选择项(&S)";
      this.miBackSel.Click += new System.EventHandler(this.miBackSel_Click);
      // 
      // menuItem2
      // 
      this.menuItem2.Index = 1;
      this.menuItem2.Text = "-";
      // 
      // miBackDef
      // 
      this.miBackDef.Index = 2;
      this.miBackDef.Text = "备份建议项(&D)";
      this.miBackDef.Click += new System.EventHandler(this.miBackDef_Click);
      // 
      // miBackAll
      // 
      this.miBackAll.Index = 3;
      this.miBackAll.Text = "备份所有项(&A)";
      this.miBackAll.Click += new System.EventHandler(this.miBackAll_Click);
      // 
      // groupBox1
      // 
      this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
        | System.Windows.Forms.AnchorStyles.Right)));
      this.groupBox1.Controls.Add(this.label6);
      this.groupBox1.Controls.Add(this.label5);
      this.groupBox1.Controls.Add(this.label4);
      this.groupBox1.Controls.Add(this.label3);
      this.groupBox1.Controls.Add(this.label2);
      this.groupBox1.Controls.Add(this.label1);
      this.groupBox1.Location = new System.Drawing.Point(4, 204);
      this.groupBox1.Name = "groupBox1";
      this.groupBox1.Size = new System.Drawing.Size(560, 188);
      this.groupBox1.TabIndex = 1;
      this.groupBox1.TabStop = false;
      this.groupBox1.Text = "驱动程序信息";
      // 
      // label6
      // 
      this.label6.AutoSize = true;
      this.label6.Location = new System.Drawing.Point(12, 160);
      this.label6.Name = "label6";
      this.label6.Size = new System.Drawing.Size(85, 17);
      this.label6.TabIndex = 5;
      this.label6.Text = "驱动程序文件:";
      // 
      // label5
      // 
      this.label5.AutoSize = true;
      this.label5.Location = new System.Drawing.Point(12, 132);
      this.label5.Name = "label5";
      this.label5.Size = new System.Drawing.Size(85, 17);
      this.label5.TabIndex = 4;
      this.label5.Text = "微软数字签名:";
      // 
      // label4
      // 
      this.label4.AutoSize = true;
      this.label4.Location = new System.Drawing.Point(12, 108);
      this.label4.Name = "label4";
      this.label4.Size = new System.Drawing.Size(85, 17);
      this.label4.TabIndex = 3;
      this.label4.Text = "驱动程序版本:";
      // 
      // label3
      // 
      this.label3.AutoSize = true;
      this.label3.Location = new System.Drawing.Point(12, 80);
      this.label3.Name = "label3";
      this.label3.Size = new System.Drawing.Size(85, 17);
      this.label3.TabIndex = 2;
      this.label3.Text = "驱动发布日期:";
      // 
      // label2
      // 
      this.label2.AutoSize = true;
      this.label2.Location = new System.Drawing.Point(12, 52);
      this.label2.Name = "label2";
      this.label2.Size = new System.Drawing.Size(85, 17);
      this.label2.TabIndex = 1;
      this.label2.Text = "驱动发布厂商:";
      // 
      // label1
      // 
      this.label1.AutoSize = true;
      this.label1.Location = new System.Drawing.Point(12, 24);
      this.label1.Name = "label1";
      this.label1.Size = new System.Drawing.Size(85, 17);
      this.label1.TabIndex = 0;
      this.label1.Text = "驱动设备名称:";
      // 
      // statusBar1
      // 
      this.statusBar1.Location = new System.Drawing.Point(0, 399);
      this.statusBar1.Name = "statusBar1";
      this.statusBar1.Size = new System.Drawing.Size(568, 22);
      this.statusBar1.TabIndex = 2;
      // 
      // contextMenu1
      // 
      this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                                 this.menuItem1,
                                                                                 this.menuItem3});
      // 
      // menuItem1
      // 
      this.menuItem1.Index = 0;
      this.menuItem1.Shortcut = System.Windows.Forms.Shortcut.CtrlA;
      this.menuItem1.Text = "全选";
      this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
      // 
      // menuItem3
      // 
      this.menuItem3.Index = 1;
      this.menuItem3.Shortcut = System.Windows.Forms.Shortcut.CtrlZ;
      this.menuItem3.Text = "反选";
      this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
      // 
      // menuItem5
      // 
      this.menuItem5.Index = 2;
      this.menuItem5.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                              this.menuItem6});
      this.menuItem5.Text = "帮助(&H)";
      // 
      // menuItem6
      // 
      this.menuItem6.Index = 0;
      this.menuItem6.Text = "关于(&A)...";
      this.menuItem6.Click += new System.EventHandler(this.menuItem6_Click);
      // 
      // FormMain
      // 
      this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
      this.ClientSize = new System.Drawing.Size(568, 421);
      this.Controls.Add(this.statusBar1);
      this.Controls.Add(this.groupBox1);
      this.Controls.Add(this.DriverListView);
      this.Menu = this.mainMenu;
      this.Name = "FormMain";
      this.Text = "驱动备份";

⌨️ 快捷键说明

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