Exemple #1
0
        private void StartPuTTY(MachineViewModel machine)
        {
            if (!File.Exists(Settings.Default.PuTTYPath))
            {
                Status = "PuTTY Path Required";
                return;
            }
            if (string.IsNullOrWhiteSpace(machine.MachineInfo.PuTTYSession))
            {
                Status = "Session Name Required";
                return;
            }

            var keyName = $@"SOFTWARE\SimonTatham\PuTTY\Sessions\{machine.MachineInfo.PuTTYSession}";

            using (var key = Registry.CurrentUser.OpenSubKey(keyName, true))
            {
                if (key == null)
                {
                    Status = $"Not Found Session \"{machine.MachineInfo.PuTTYSession}\"";
                    return;
                }
                key.SetValue("HostName", $"{machine.MachineInfo.UserName}@{machine.IPAddress}");
            }

            var pi = new ProcessStartInfo
            {
                FileName  = Settings.Default.PuTTYPath,
                Arguments = $"-load {machine.MachineInfo.PuTTYSession} -pw {machine.MachineInfo.Password}",
            };

            Process.Start(pi);
            Status = "Connecting...";
        }
Exemple #2
0
        private void StartWinSCP(MachineViewModel machine)
        {
            if (!File.Exists(Settings.Default.WinSCPPath))
            {
                Status = "WinSCP Path Required";
                return;
            }

            var pi = new ProcessStartInfo
            {
                FileName  = Settings.Default.WinSCPPath,
                Arguments = $"{machine.MachineInfo.UserName}:{machine.MachineInfo.Password}@{machine.IPAddress}",
            };

            Process.Start(pi);
            Status = "Connecting...";
        }
Exemple #3
0
 private void StartBrowser(MachineViewModel machine)
 {
     Process.Start($"http://{machine.IPAddress}");
 }