Esempio n. 1
0
 private void FileZilla_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     if (Bindings.isipselected)
     {
         Log($"FileZilla sftp://login:password@{SelectedIP.NBNameOrIP()}:22", false, false, "", false);
         string filezilla = "";
         if (System.IO.File.Exists(settings.Fields.filezilla_path))
         {
             filezilla = settings.Fields.filezilla_path;
         }
         else
         {
             string         text    = System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "SupportTools");
             SettingsWindow tempSet = new SettingsWindow();
             tempSet.Visibility = Visibility.Collapsed;
             if (tempSet.LocateFile(ref text, "FileZilla*.exe"))
             {
                 settings.Fields.filezilla_path = text;
             }
             settings.SaveSettings();
             tempSet.Close();
             filezilla = settings.Fields.filezilla_path;
         }
         if (System.IO.File.Exists(settings.Fields.filezilla_path))
         {
             //StartProgramSupportTools(settings.Fields.filezilla_path, $"sftp://{SelectedCredentials.Login}:{SelectedCredentials.Password}@{SelectedIP.Address}:22", true); /*-a =% userprofile %\\Desktop*/
             ExecuteProgram(filezilla, $"sftp://{SelectedCredentials.Login}:{SelectedCredentials.Password}@{SelectedIP.IPAddress}:22", false, true, "", false, "", "");
         }
     }
 }
Esempio n. 2
0
        private void PuttyTelnet_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            //StartProgramSupportTools("putty.exe",
            //   $"-telnet {SelectedIP.Address}"); //-v ЦВЗ№{SelectedIP.Owner.NumberCVZ} {SelectedIP.Address} -l fawgv -pw 1

            if (Bindings.isipselected)
            {
                string putty;
                string arguments;
                this.Log("Putty Telnet " + SelectedIP.NBNameOrIP(), false, false, "", false);

                arguments = $"-telnet {SelectedIP.IPAddress}";

                if (System.IO.File.Exists(settings.Fields.putty_path))
                {
                    putty = settings.Fields.putty_path;
                }
                else
                {
                    putty = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"SupportTools\putty.exe");
                }

                ExecuteProgram(putty, arguments, false, true, "", false, "", "");
            }
        }
Esempio n. 3
0
 private void WinSCP_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     if (Bindings.isipselected)
     {
         Log($"WinSCP sftp://login:password@{SelectedIP.NBNameOrIP()}:22", false, false, "", false);
         ExecuteProgram(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"SupportTools\WinSCP.exe"), $"sftp://{SelectedCredentials.Login}:{SelectedCredentials.Password}@{SelectedIP.IPAddress}:22", false, true, "", false, "", "");
     }
 }
Esempio n. 4
0
 private void BrowserHostRun_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     if (Bindings.isipselected)
     {
         //StartProgramSupportTools("explorer.exe", $"http://{SelectedIP.Address}", true);
         Log("Запуск " + SelectedIP.NBNameOrIP() + " в браузере по умолчанию", false, false, "", false);
         ExecuteProgram("explorer.exe", $"http://{SelectedIP.IPAddress}", false, true, "", false, "", "");
     }
 }
Esempio n. 5
0
        private void WinboxMikrotik_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            //StartProgramSupportTools("winbox.exe", $"{SelectedIP.Address} {SelectedCredentials.Login} {SelectedCredentials.Password}");
            try
            {
                if (Bindings.isipselected)
                {
                    string winbox;
                    string arguments;
                    Log("Winbox MikroTik " + SelectedIP.NBNameOrIP(), false, false, "", false);
                    if (!string.IsNullOrWhiteSpace(SelectedCredentials.Login))
                    {
                        arguments = $"{SelectedIP.IPAddress} {SelectedCredentials.Login} ";
                        if (!string.IsNullOrWhiteSpace(SelectedCredentials.Password))
                        {
                            arguments = arguments + SelectedCredentials.Password;
                        }
                    }
                    else
                    {
                        arguments = SelectedIP.IPAddress;
                    }

                    if (settings.Fields.winboxmikrotik_path_usedefault && File.Exists(settings.Fields.winboxmikrotikpath))
                    {
                        winbox = settings.Fields.winboxmikrotikpath;
                    }
                    else
                    {
                        winbox = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"SupportTools\winbox.exe");
                    }

                    ExecuteProgram(winbox, arguments, false, true, "", false, "", "");
                }
            }
            catch (Exception ex)
            {
                Log(ex.Message, true, false, ex.StackTrace);
            }
        }
Esempio n. 6
0
        private void PuttySSH_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            //if (System.IO.File.Exists(settings.Fields.putty_path))
            //{
            //    StartProgramSupportTools(settings.Fields.putty_path,
            //    $"-ssh {SelectedIP.Address} -l {SelectedCredentials.Login} -pw {SelectedCredentials.Password}", true); //-v ЦВЗ№{SelectedIP.Owner.NumberCVZ} {SelectedIP.Address} -l fawgv -pw 1
            //}
            //else
            //    StartProgramSupportTools("putty.exe",
            //    $"-ssh {SelectedIP.Address} -l {SelectedCredentials.Login} -pw {SelectedCredentials.Password}"); //-v ЦВЗ№{SelectedIP.Owner.NumberCVZ} {SelectedIP.Address} -l fawgv -pw 1

            if (Bindings.isipselected)
            {
                string putty;
                string arguments;
                this.Log("Putty SSH " + SelectedIP.NBNameOrIP(), false, false, "", false);
                if (!string.IsNullOrWhiteSpace(SelectedCredentials.Login))
                {
                    arguments = $"-ssh {SelectedCredentials.Login}@{SelectedIP.IPAddress} 22";
                    if (!string.IsNullOrWhiteSpace(SelectedCredentials.Password))
                    {
                        arguments = arguments + " -pw " + SelectedCredentials.Password;
                    }
                }
                else
                {
                    arguments = SelectedIP.IPAddress;
                }
                if (System.IO.File.Exists(settings.Fields.putty_path))
                {
                    putty = settings.Fields.putty_path;
                }
                else
                {
                    putty = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"SupportTools\putty.exe");
                }

                ExecuteProgram(putty, arguments, false, true, "", false, "", "");
            }
        }