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

📄 form1.cs

📁 可以将SQL Server Backup文件恢复在不同的地方(缺省情况下SQL Server Backup文件只能恢复到原来的备份目录)
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.IO;

namespace TestRestore
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.PictureBox pictureBox1;
		private System.Windows.Forms.TextBox Password;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.TextBox UserName;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.RadioButton SQLServer;
		private System.Windows.Forms.RadioButton Windows;
		private System.Windows.Forms.TextBox Server;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.TextBox BackUpFile;
		private System.Windows.Forms.Button BackUp;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.ComboBox DatabaseList;
		private System.Windows.Forms.RadioButton NewDatabase;
		private System.Windows.Forms.RadioButton ExistingDatabase;
		private System.Windows.Forms.TextBox DataBasePath;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.TextBox DataBaseName;
		private System.Windows.Forms.Button Path;
		private System.Windows.Forms.Button RefreshDatabases;
		private System.Windows.Forms.ProgressBar pbar;
		private System.Windows.Forms.Panel SQLServerPanel;
		private System.Windows.Forms.Panel FilePanel;
		private System.Windows.Forms.Panel ProgressPanel;
		private System.Windows.Forms.Panel WelcomePanel;
		private System.Windows.Forms.Panel DestinationPanel;
		private System.Windows.Forms.Panel panel1;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.PictureBox pictureBox2;
		private System.Windows.Forms.Button Finish;
		private System.Windows.Forms.Button Next;
		private System.Windows.Forms.Button Previous;
		private System.Windows.Forms.Button Cancel;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.GroupBox groupBox2;
		private System.Windows.Forms.Label label10;
		private System.Windows.Forms.Panel FinishPanel;
		private System.Windows.Forms.Label FinsihLabel;
		private System.Windows.Forms.Label StatusLabel;
		private System.Windows.Forms.Label label11;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		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()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
			this.pictureBox1 = new System.Windows.Forms.PictureBox();
			this.Password = new System.Windows.Forms.TextBox();
			this.label5 = new System.Windows.Forms.Label();
			this.UserName = new System.Windows.Forms.TextBox();
			this.label4 = new System.Windows.Forms.Label();
			this.SQLServer = new System.Windows.Forms.RadioButton();
			this.Windows = new System.Windows.Forms.RadioButton();
			this.Server = new System.Windows.Forms.TextBox();
			this.label3 = new System.Windows.Forms.Label();
			this.BackUpFile = new System.Windows.Forms.TextBox();
			this.BackUp = new System.Windows.Forms.Button();
			this.label6 = new System.Windows.Forms.Label();
			this.DatabaseList = new System.Windows.Forms.ComboBox();
			this.NewDatabase = new System.Windows.Forms.RadioButton();
			this.ExistingDatabase = new System.Windows.Forms.RadioButton();
			this.DataBasePath = new System.Windows.Forms.TextBox();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.DataBaseName = new System.Windows.Forms.TextBox();
			this.Path = new System.Windows.Forms.Button();
			this.RefreshDatabases = new System.Windows.Forms.Button();
			this.pbar = new System.Windows.Forms.ProgressBar();
			this.StatusLabel = new System.Windows.Forms.Label();
			this.SQLServerPanel = new System.Windows.Forms.Panel();
			this.FilePanel = new System.Windows.Forms.Panel();
			this.ProgressPanel = new System.Windows.Forms.Panel();
			this.WelcomePanel = new System.Windows.Forms.Panel();
			this.label10 = new System.Windows.Forms.Label();
			this.DestinationPanel = new System.Windows.Forms.Panel();
			this.panel1 = new System.Windows.Forms.Panel();
			this.pictureBox2 = new System.Windows.Forms.PictureBox();
			this.label9 = new System.Windows.Forms.Label();
			this.label8 = new System.Windows.Forms.Label();
			this.Finish = new System.Windows.Forms.Button();
			this.Next = new System.Windows.Forms.Button();
			this.Previous = new System.Windows.Forms.Button();
			this.Cancel = new System.Windows.Forms.Button();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.FinishPanel = new System.Windows.Forms.Panel();
			this.FinsihLabel = new System.Windows.Forms.Label();
			this.label11 = new System.Windows.Forms.Label();
			this.SQLServerPanel.SuspendLayout();
			this.FilePanel.SuspendLayout();
			this.ProgressPanel.SuspendLayout();
			this.WelcomePanel.SuspendLayout();
			this.DestinationPanel.SuspendLayout();
			this.panel1.SuspendLayout();
			this.FinishPanel.SuspendLayout();
			this.SuspendLayout();
			// 
			// pictureBox1
			// 
			this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
			this.pictureBox1.Location = new System.Drawing.Point(6, 29);
			this.pictureBox1.Name = "pictureBox1";
			this.pictureBox1.Size = new System.Drawing.Size(32, 32);
			this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
			this.pictureBox1.TabIndex = 20;
			this.pictureBox1.TabStop = false;
			// 
			// Password
			// 
			this.Password.Enabled = false;
			this.Password.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(178)));
			this.Password.Location = new System.Drawing.Point(152, 192);
			this.Password.Name = "Password";
			this.Password.PasswordChar = '

⌨️ 快捷键说明

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