コード例 #1
0
ファイル: Form1.cs プロジェクト: Szelma139/.NET-SSH
        private void button1_Click(object sender, EventArgs e)
        {
            PathSettings.localPath  = @"C:\Users\radek\Documents\";
            PathSettings.remotePath = @"/home/radek/Pliki/";
            ConnectionSettings connection = new ConnectionSettings();

            connection.Ip = ipTextBox.Text;
            int  n;
            bool isNumeric = int.TryParse(portTextBox.Text, out n);

            connection.Port     = portTextBox.Text;
            connection.Username = "******";
            connection.Password = "******";

            if (!isNumeric)
            {
                var result = System.Windows.Forms.MessageBox.Show("Błąd", "Niepoprawny format portu", System.Windows.Forms.MessageBoxButtons.OK);
            }
            else
            {
                CustomController controller = new CustomController(connector = new Connector(connection, customProgressBar));
                controller.processDownloads();
            }


            //    statusLabel.Text = connector.getConnectionStatus();
//
            //    listOfFiles = connector.sendCommand();
            //    Thread thr = new Thread(new ThreadStart(connector.downloadFile));
            //   thr.Start();
        }