Example #1
0
 private void txtPassword_LostFocus(object sender, RoutedEventArgs e)
 {
     Profile profile = cmbProfiles.SelectedItem as Profile;
     if (profile != null)
     {
         SimpleAES aes = new SimpleAES();
         profile.Password = aes.Encrypt(txtPassword.Password);
         TextBox_LostFocus(sender, e);
     }
 }
Example #2
0
        /// <summary>
        /// Launches the specifed command path
        /// </summary>
        /// <param name="path">The path of the command</param>
        public void LaunchProgram(string path)
        {
            string pass = new SimpleAES().Decrypt(_password);
            Win32.LogonFlags flags =
                _netOnly ? Win32.LogonFlags.NetCredentialsOnly :
                _noProfile ? Win32.LogonFlags.None : Win32.LogonFlags.WithProfile;

            Win32.LaunchCommand(path, _domain, _userName, pass, flags);
        }
Example #3
0
 private void cmbProfiles_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     Profile profile = cmbProfiles.SelectedItem as Profile;
     this.DataContext = profile;
     if (profile != null)
     {
         SimpleAES aes = new SimpleAES();
         if (string.IsNullOrWhiteSpace(profile.Password))
             txtPassword.Password = "";
         else
             txtPassword.Password = aes.Decrypt(profile.Password);
     }
 }