Exemplo n.º 1
0
        private void addServerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddServer dlg = new AddServer();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Microsoft.Win32.RegistryKey WindowsBackupMon_key;
                WindowsBackupMon_key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("WindowsBackupMon");

                String Servername = dlg.textBox_server.Text;
                String User       = dlg.textBox_user.Text;
                String Pass       = dlg.textBox_password.Text;
                Pass = Encrypt(Pass);

                WindowsBackupMon_key.SetValue(Servername, new string[] { User, Pass }, Microsoft.Win32.RegistryValueKind.MultiString);
                WindowsBackupMon_key.Close();
            }
        }