示例#1
0
        private void btnDownloadFolder_Click(object sender, EventArgs e)
        {
            if (dlgFolder.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            frmTransferFolder FRMFolder = new frmTransferFolder();

            FRMFolder.RemoteFolder = this.txtPath.Text;
            FRMFolder.LocalFolder  = this.dlgFolder.SelectedPath;
            FRMFolder.CommandSock  = this.Client;

            if (FRMFolder.ShowDialog() == DialogResult.OK)
            {
                MessageBox.Show("Folder downloaded!");
            }
        }
示例#2
0
        private void downloadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Convert.ToString(this.lstDirectory.SelectedItem) != "")
            {
                string SelectedDir = Convert.ToString(this.lstDirectory.SelectedItem);
                if (SelectedDir != ".." && SelectedDir != ".")
                {
                    if (this.txtPath.Text.EndsWith("/"))
                    {
                        this.txtPath.Text += SelectedDir;
                    }
                    else
                    {
                        this.txtPath.Text += "/" + SelectedDir;
                    }

                    if (dlgFolder.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }



                    frmTransferFolder FRMFolder = new frmTransferFolder();

                    if (MessageBox.Show("Do you want to replace existing files?", "Question!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        FRMFolder.OverwriteFiles = false;
                    }

                    FRMFolder.RemoteFolder = this.txtPath.Text;
                    FRMFolder.LocalFolder  = this.dlgFolder.SelectedPath;
                    FRMFolder.CommandSock  = this.Client;

                    if (FRMFolder.ShowDialog() == DialogResult.OK)
                    {
                        MessageBox.Show("Folder downloaded!");
                    }

                    EnterDir(this.txtPath.Text);
                }
            }
        }