这是代码:
response.Close()
ftpWebRequest = WebRequest.Create(ftp_location & dr("FILE_LOCATION").ToString.Replace("~", ""))
ftpWebRequest.Credentials = New NetworkCredential(ftp_user, ftp_pw)
ftpWebRequest.Method = WebRequestMethods.Ftp.UploadFile
ftpWebRequest.UseBinary = True
ftpSourceRequest = WebRequest.Create(ftp_source & dr("FILE_LOCATION").ToString.Replace("~", ""))
ftpSourceRequest.Credentials = New NetworkCredential(ftp_user, ftp_pw)
ftpSourceRequest.Method = WebRequestMethods.Ftp.DownloadFile
ftpSourceRequest.UseBinary = True
Try
ftpSourceResponse = ftpSourceRequest.GetResponse()
Dim t As System.Net.FtpStatusCode = ftpSourceResponse.StatusCode
Dim responseStream As IO.Stream = ftpSourceResponse.GetResponseStream
ftpStreamWriter = New StreamWriter(ftpWebRequest.GetRequestStream())
ftpStreamWriter.Write(New StreamReader(responseStream).ReadToEnd)
dr("STATUS") = "OK"
dr.AcceptChanges()
ftpStreamWriter.Close()
response.Close()
ftpSourceResponse.Close()
Catch ex4 As Exception
response.Close()
ftpSourceResponse.Close()
End Try
问题是,当我实际从源下载文件时,然后将其上传到目的地。文件中唯一的内容是一段文字,上面写着“System.IO.Streamreader”我在这里做错了什么?