/// <summary> /// /// </summary> /// <param name="hosts"></param> public static void SaveHostsInfos(List <HostInfo> hosts) { var json = JsonConvert.SerializeObject(hosts); var encryptedJson = EncrytionHelper.Encrypt(json); File.WriteAllText(HostsFile, encryptedJson); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SaveButton_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrEmpty(PasswordBox.Password)) { ViewModel.SftpPassword = EncrytionHelper.Encrypt(PasswordBox.Password); } SetTaskData(ViewModel); Close(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SaveButton_Click(object sender, RoutedEventArgs e) { var hostInfo = new HostSubmitInfo(); hostInfo.Host = HostsCombobox.Text; hostInfo.Login = LoginsCombobox.Text; hostInfo.Password = PasswordBox.Password; HostDataManager.SubmitHostInfo(hostInfo); ViewModel.SshHost = HostsCombobox.Text; ViewModel.SshLogin = LoginsCombobox.Text; ViewModel.ServiceName = ServiceTextBox.Text; if (!string.IsNullOrEmpty(PasswordBox.Password)) { ViewModel.SshPassword = EncrytionHelper.Encrypt(PasswordBox.Password); } SetTaskData(ViewModel); Close(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SaveButton_Click(object sender, RoutedEventArgs e) { var hostInfo = new HostSubmitInfo(); hostInfo.Host = HostsCombobox.Text; hostInfo.Login = LoginsCombobox.Text; hostInfo.Password = PasswordBox.Password; HostDataManager.SubmitHostInfo(hostInfo); ViewModel.SshHost = HostsCombobox.Text; ViewModel.SshLogin = LoginsCombobox.Text; ViewModel.Command = CmdTextBox.Text; ViewModel.IsRoot = IsRootCheckBox.IsChecked.GetValueOrDefault(); if (!string.IsNullOrEmpty(PasswordBox.Password)) { ViewModel.SshPassword = EncrytionHelper.Encrypt(PasswordBox.Password); } SetTaskData(ViewModel); Close(); }