Пример #1
0
        private bool DeleteRemoteFile(string file)
        {
            bool return_value = false;

            if (SshConnection.ExecBashCommand("rm " + file) != null)
            {
                return_value = true;
            }
            return(return_value);
        }
Пример #2
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            listView_Local.DoubleClick          += new EventHandler(listView_Local_DoubleClick);
            listView_Local.SelectedIndexChanged += new EventHandler(listView_Local_SelectedIndexChanged);

            listView_remote.DoubleClick          += new EventHandler(listView_remote_DoubleClick);
            listView_remote.SelectedIndexChanged += new EventHandler(listView_remote_SelectedIndexChanged);

            if (!File.Exists(SaveSetting.path_to_set_file))
            {
                FormSettings frm_set = new FormSettings();
                frm_set.ShowDialog();
            }
            SshConnection.KillSSH();
            if (!SshConnection.InitSSH())
            {
                MessageBox.Show("Ошибка загрузки файла настроек" + Environment.NewLine + "Удалите файл " + SaveSetting.path_to_set_file + Environment.NewLine + "и перезапустите программу.");
                Application.Exit();
            }
            GetDirs("", listView_Local);
        }
Пример #3
0
 static void Main(string[] argc)
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     if ((argc.Length > 0) && (File.Exists(argc[0])))
     {
         //MessageBox.Show(argc[0]);
         FileInfo fi = new FileInfo(argc[0]);
         if (!SshConnection.InitSSH())
         {
             MessageBox.Show("Ошибка загрузки файла настроек" + Environment.NewLine + "Удалите файл " + SaveSetting.path_to_set_file + Environment.NewLine + "и перезапустите программу.");
             Application.Exit();
         }
         Application.Run(new FormAction(fi.FullName, fi.Name, true, fi.DirectoryName));
         SshConnection.KillSSH();
     }
     else
     {
         //MessageBox.Show(argc[0]);
         Application.Run(new FormMain());
     }
 }
Пример #4
0
 private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     SshConnection.KillSSH();
 }