WinSCP를 변수와 함께 사용하여 원격 루트 폴더에서 특정 파일을 자동 다운로드합니다. 연결에 문제가 없지만 다운로드를 시도 할 때 'No such file or directory'오류가 발생합니다.WinSCP Session.GetFiles error 해당 파일 또는 디렉터리가 없습니다.
이' Setup session variables, connect, and download file
Dim remotefile As String = "text.zip"
Dim localpath As String = "D:\Work\Returns\"
Dim sessionOptions As New SessionOptions
With sessionOptions
.Protocol = Protocol.Sftp
.HostName = myftpaddress
.UserName = myftpuser
.Password = myftppass
.SshHostKeyFingerprint = SSH
End With
Using session As New Session
'go ahead & connect
session.Open(sessionOptions)
Dim transferOptions As New TransferOptions
transferOptions.TransferMode = TransferMode.Binary
Dim transferResult As TransferOperationResult
'now get the file
transferResult = session.GetFiles("/" & remotefile, localpath, False, transferOptions)
End Using
설명서에 따라 : "파일 전송 코드를 생성하는 대화 상자를 열려면 : (전송) 옵션> [전송 옵션] 대화 상자 (https://winscp.net/eng/)에서 코드 전송 * 명령을 사용하십시오. docs/ui_copy) " –
그리고 도움을 더 원한다면 로그를 보여주세요! –
알았어요, 마틴. 고맙습니다. 코드 생성 기능 사용에 대한 귀하의 제안은 무엇입니까? 어떤 이유로 그것은 로컬 경로에 "*"를 추가 할 것을 제안했습니다. 이상하지만 작동합니다. :) – TheoH