private void LoadDefaultValue() { this.Text = this.Text + " (V " + Application.ProductVersion + ")"; //加载上一次的配置 BackupDataBase.Properties.Settings thisSet = new BackupDataBase.Properties.Settings(); chkProfundityTactic.Checked = thisSet.ProfundityTactic; chkRestore.Checked = thisSet.RestoreDB; chkShrinkDBB.Checked = thisSet.ShrinkDBBefore; txtServer.Text = thisSet.Server; txtDataBase.Text = thisSet.DataBase; txtUserID.Text = thisSet.UserID; if (thisSet.Password == "") { txtPassword.Text = ""; } else { txtPassword.Text = se.ThreeDESDecrypt(thisSet.Password, "WangYu", "chanfengsr"); } txtAimServer.Text = thisSet.AimServer; txtSharePath.Text = thisSet.SharPath; txtUserIDc.Text = thisSet.UserIDc; if (thisSet.Passwordc == "") { txtPasswordc.Text = ""; } else { txtPasswordc.Text = se.ThreeDESDecrypt(thisSet.Passwordc, "WangYu", "chanfengsr"); } chkShrinkDBA.Checked = thisSet.ShrinkDBAfter; chkForceRestore.Checked = thisSet.ForceRestore; chkDeleteBackupFile.Checked = thisSet.DeleteBackupFile; txtAimRestoreServer.Text = thisSet.AimRestoreServer; txtRestoreServerUserID.Text = thisSet.RestoreServerUserID; txtRestoreDBName.Text = thisSet.RestoreDBName; txtRestoreFolder.Text = thisSet.RestoreFolder; if (thisSet.RestoreServerPwd == "") { txtRestoreServerPwd.Text = ""; } else { txtRestoreServerPwd.Text = se.ThreeDESDecrypt(thisSet.RestoreServerPwd, "WangYu", "chanfengsr"); } }
private void SaveConfig() { BackupDataBase.Properties.Settings thisSet = new BackupDataBase.Properties.Settings(); thisSet.ProfundityTactic = chkProfundityTactic.Checked; thisSet.ShrinkDBBefore = chkShrinkDBB.Checked; thisSet.RestoreDB = chkRestore.Checked; thisSet.Server = txtServer.Text; thisSet.DataBase = txtDataBase.Text; thisSet.UserID = txtUserID.Text; if (txtPassword.Text.Trim() == "") { thisSet.Password = txtPassword.Text; } else { thisSet.Password = se.ThreeDESEncrypt(txtPassword.Text, "WangYu", "chanfengsr"); } thisSet.AimServer = txtAimServer.Text; thisSet.SharPath = txtSharePath.Text; thisSet.UserIDc = txtUserIDc.Text; if (txtPasswordc.Text == "") { thisSet.Passwordc = txtPasswordc.Text; } else { thisSet.Passwordc = se.ThreeDESEncrypt(txtPasswordc.Text, "WangYu", "chanfengsr"); } thisSet.ShrinkDBAfter = chkShrinkDBA.Checked; thisSet.ForceRestore = chkForceRestore.Checked; thisSet.DeleteBackupFile = chkDeleteBackupFile.Checked; thisSet.AimRestoreServer = txtAimRestoreServer.Text; thisSet.RestoreServerUserID = txtRestoreServerUserID.Text; thisSet.RestoreDBName = txtRestoreDBName.Text; thisSet.RestoreFolder = txtRestoreFolder.Text; if (txtRestoreServerPwd.Text == "") { thisSet.RestoreServerPwd = ""; } else { thisSet.RestoreServerPwd = se.ThreeDESEncrypt(txtRestoreServerPwd.Text, "WangYu", "chanfengsr"); } thisSet.Save(); }
private void SaveConfig() { BackupDataBase.Properties.Settings thisSet = new BackupDataBase.Properties.Settings(); thisSet.ProfundityTactic = chkProfundityTactic.Checked; thisSet.ShrinkDBBefore = chkShrinkDBB.Checked; thisSet.RestoreDB = chkRestore.Checked; thisSet.Server = txtServer.Text; thisSet.DataBase = txtDataBase.Text; thisSet.UserID = txtUserID.Text; if (txtPassword.Text.Trim() == "") { thisSet.Password = txtPassword.Text; } else { thisSet.Password = se.ThreeDESEncrypt(txtPassword.Text, "WangYu", "chanfengsr"); } thisSet.AimServer = txtAimServer.Text; thisSet.SharPath = txtSharePath.Text; thisSet.UserIDc = txtUserIDc.Text; if (txtPasswordc.Text == "") { thisSet.Passwordc = txtPasswordc.Text; } else { thisSet.Passwordc = se.ThreeDESEncrypt(txtPasswordc.Text, "WangYu", "chanfengsr"); } thisSet.ShrinkDBAfter = chkShrinkDBA.Checked; thisSet.ForceRestore = chkForceRestore.Checked; thisSet.DeleteBackupFile = chkDeleteBackupFile.Checked; thisSet.AimRestoreServer = txtAimRestoreServer.Text; thisSet.RestoreServerUserID = txtRestoreServerUserID.Text; thisSet.RestoreDBName = txtRestoreDBName.Text; thisSet.RestoreFolder = txtRestoreFolder.Text; if (txtRestoreServerPwd.Text == "") { thisSet.RestoreServerPwd = ""; } else { thisSet.RestoreServerPwd = se.ThreeDESEncrypt(txtRestoreServerPwd.Text, "WangYu", "chanfengsr"); } thisSet.Save(); }
private void LoadDefaultValue() { this.Text = this.Text + " (V " + Application.ProductVersion + ")"; //������һ�ε����� BackupDataBase.Properties.Settings thisSet = new BackupDataBase.Properties.Settings(); chkProfundityTactic.Checked = thisSet.ProfundityTactic; chkRestore.Checked = thisSet.RestoreDB; chkShrinkDBB.Checked = thisSet.ShrinkDBBefore; txtServer.Text = thisSet.Server; txtDataBase.Text = thisSet.DataBase; txtUserID.Text = thisSet.UserID; if (thisSet.Password == "") { txtPassword.Text = ""; } else { txtPassword.Text = se.ThreeDESDecrypt(thisSet.Password, "WangYu", "chanfengsr"); } txtAimServer.Text = thisSet.AimServer; txtSharePath.Text = thisSet.SharPath; txtUserIDc.Text = thisSet.UserIDc; if (thisSet.Passwordc == "") { txtPasswordc.Text = ""; } else { txtPasswordc.Text = se.ThreeDESDecrypt(thisSet.Passwordc, "WangYu", "chanfengsr"); } chkShrinkDBA.Checked = thisSet.ShrinkDBAfter; chkForceRestore.Checked = thisSet.ForceRestore; chkDeleteBackupFile.Checked = thisSet.DeleteBackupFile; txtAimRestoreServer.Text = thisSet.AimRestoreServer; txtRestoreServerUserID.Text = thisSet.RestoreServerUserID; txtRestoreDBName.Text = thisSet.RestoreDBName; txtRestoreFolder.Text = thisSet.RestoreFolder; if (thisSet.RestoreServerPwd == "") { txtRestoreServerPwd.Text = ""; } else { txtRestoreServerPwd.Text = se.ThreeDESDecrypt(thisSet.RestoreServerPwd, "WangYu", "chanfengsr"); } }