Exemplo n.º 1
0
        protected void btnDownLoad_Click(object sender, EventArgs e)
        {
            RemoteDownload downloadClient = null;

            if (this.rbDownloadList.SelectedIndex == 0)
            {
                downloadClient =
                    new HttpRemoteDownload(this.tbDownloadUrl.Text, this.tbDownloadPath.Text);
            }
            else
            {
                downloadClient =
                    new FtpRemoteDownload(this.tbDownloadUrl.Text, this.tbDownloadPath.Text);

            }

            if (downloadClient.DownloadFile())
            {
                Response.Write("下载完成");
            }
            else
            {
                Response.Write(" 下载失败");
            }
        }
Exemplo n.º 2
0
        protected void btnDownLoad_Click(object sender, EventArgs e)
        {
            RemoteDownload downloadClient = null;

            if (this.rbDownloadList.SelectedIndex == 0)
            {
                downloadClient = new HttpRemoteDownload(this.tbDownloadUrl.Text,
                                                        this.tbDownloadPath.Text);
            }
            else
            {
                downloadClient = new FtpRemoteDownload(this.tbDownloadUrl.Text,
                                                       this.tbDownloadPath.Text);
            }

            if (downloadClient.DownloadFile())
            {
                Response.Write("Download is complete");
            }
            else
            {
                Response.Write("Failed to download");
            }
        }