Пример #1
0
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            RemoteUpload uploadClient = null;

            if (this.rbUploadList.SelectedIndex == 0)
            {
                uploadClient = new HttpRemoteUpload(this.FileUpload.FileBytes,
                                                    this.FileUpload.PostedFile.FileName, this.tbUploadUrl.Text);
            }
            else
            {
                uploadClient = new FtpRemoteUpload(this.FileUpload.FileBytes,
                                                   this.FileUpload.PostedFile.FileName, this.tbUploadUrl.Text);
            }

            if (uploadClient.UploadFile())
            {
                Response.Write("Upload is complete");
            }
            else
            {
                Response.Write("Failed to upload");
            }
        }
Пример #2
0
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            RemoteUpload uploadClient = null;

            if (this.rbUploadList.SelectedIndex == 0)
            {
                uploadClient =
                    new HttpRemoteUpload(this.FileUpload.FileBytes, this.FileUpload.PostedFile.FileName, this.tbUploadUrl.Text);
            }
            else
            {
                uploadClient =
                    new FtpRemoteUpload(this.FileUpload.FileBytes, this.FileUpload.PostedFile.FileName, this.tbUploadUrl.Text);
            }

            if (uploadClient.UploadFile())
            {
                Response.Write("上传完成");
            }
            else
            {
                Response.Write("上传失败");
            }
        }