2

私の既存のVisualBasic6アプリケーションでは、ftpサイトに接続していました。ここで、反対側はプロトコルをftpsに変更し、ポートを22に変更しました。

私のコードは正しく機能しません。エラーvbFTPランタイムエラー「35753」「このメソッドではプロトコルがサポートされていません」が表示されます。

コードとURLのポートのみを変更しました

私の古いURLはftp.xxx.com.trのようなものでした

URLをに変更しました

sftps://ftp.xxx.com.tr

filezillaを使用して同じ場所に接続しようとしていますが、URLがsftps://ftp.xxx.com.trに変更されるため、コピーしました。スタックオーバー(MS Access 2007でPDFファイルをftpサーバーに転送する)にも同様の質問がありますが、ftpについてはありません。これは私のコードです

    With xControl
       .AccessType = icDirect
       .Protocol = icFTP
       .RemotePort = 22
       .RequestTimeout = 50
       .url = xURL
       .UserName = xUserName
       .Password = xPassword
       .Cancel
       .Execute , "DIR " & xFileName
        Do While .StillExecuting
           DoEvents: DoEvents: DoEvents
        Loop
        gLogonFtp = "Connected to Host"
   End With

お時間をいただきありがとうございます、フェルダ

4

1 に答える 1

1

私は psftp を – wqw (3 月 11 日 13:53) が彼のコメントで提案したように使用しました。これが私の新しいコードです。

これは私のスクリプトファイルです

    cd to_remotedir
    lcd C:\path2 'local dir
    mget * *
    quit

result = ChangeFileContent("*", xOnlyFileName) //here I change the content of my script file psftpcommand.bat to get a specific file 

Sleep 1000
Shell "C:/path/psftp.exe -v -pw " & xPassword & " " & xUserName & "@" & xURL & ":22 -b C:/path/psftpcommands.bat"
Sleep 1000
 result = ChangeFileContent(xOnlyFileName, "*")//here I rechanged the content of the file. Change file name to ->*

'In the below I check if the requested file has come 
Sleep 1000
If Dir("C:\path2\" & xOnlyFileName) <> "" Then
    gLogonFtp = "Successful"
    frmDataTransfers.lblTransferInfoDownLoad.Caption = "Dosya Çekildi " & xOnlyFileName
    frmDataTransfers.lblTransferInfoDownLoad.Refresh

 End If

それで全部です。

ご協力ありがとうございました。

フェルダ

于 2013-03-15T09:12:45.577 に答える