Exemple #1
0
        async private void sshConnect_Click(object sender, EventArgs e)
        {
            ProjectPOCO project = projectHelper.GetCurrentProject(ddlProjects.Text);

            if (null == project)
            {
                ShowError("No project found.");
                return;
            }
            bool isInvalid = HasErrorsForSSH();

            if (isInvalid)
            {
                AlertMessages(ref errorsForSSH);
                return;
            }
            SSHLog log = new SSHLog();

            string f = CreateFileName(Logger.LoggerTypes.sshlog.ToString(), ddlProjects.Text);

            log.IPHostname = ipHostname.Text;
            log.Project    = ddlProjects.Text;
            log.LogDate    = DateTime.Now;
            log.Username   = sshUsername.Text;
            SecureString pw = new SecureString();

            foreach (char o in sshPassword.Text)
            {
                pw.AppendChar(o);
            }
            log.PenTesterIP = sshTestingIP.Text;
            string h = await LaunchPutty(log, pw);

            DialogResult d = MessageBox.Show("Please wait while the application starts..." + Environment.NewLine + Environment.NewLine + "Was the connection successful?", "Confirm", MessageBoxButtons.YesNo);

            if (DialogResult.Yes == d)
            {
                log.wasSuccessful = true;
                projectHelper.SaveSSHData(f, log);
            }
            else
            {
                log.wasSuccessful = false;
                projectHelper.SaveSSHData(f, log);
            }
        }
Exemple #2
0
 public PuttyLaunch(SSHLog log, string _f)
 {
     InitializeComponent();
     l = log;
     f = _f;
 }
Exemple #3
0
 private void CheckExists(SSHLog log)
 {
     throw new NotImplementedException();
 }
Exemple #4
0
 async private Task <string> LaunchPutty(SSHLog v, SecureString s)
 {
     return(await Task.Run <string>(() => CmdHelper.LoadPutty(v, s)));
 }