Advertisement
Guest User

Untitled

a guest
Apr 1st, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. With xControl
  2. .AccessType = icDirect
  3. .Protocol = icFTP
  4. .RemotePort = 22
  5. .RequestTimeout = 50
  6. .url = xURL
  7. .UserName = xUserName
  8. .Password = xPassword
  9. .Cancel
  10. .Execute , "DIR " & xFileName
  11. Do While .StillExecuting
  12. DoEvents: DoEvents: DoEvents
  13. Loop
  14. gLogonFtp = "Connected to Host"
  15. End With
  16.  
  17. cd to_remotedir
  18. lcd C:path2 'local dir
  19. mget * *
  20. quit
  21.  
  22. result = ChangeFileContent("*", xOnlyFileName) //here I change the content of my script file psftpcommand.bat to get a specific file
  23.  
  24. Sleep 1000
  25. Shell "C:/path/psftp.exe -v -pw " & xPassword & " " & xUserName & "@" & xURL & ":22 -b C:/path/psftpcommands.bat"
  26. Sleep 1000
  27. result = ChangeFileContent(xOnlyFileName, "*")//here I rechanged the content of the file. Change file name to ->*
  28.  
  29. 'In the below I check if the requested file has come
  30. Sleep 1000
  31. If Dir("C:path2" & xOnlyFileName) <> "" Then
  32. gLogonFtp = "Successful"
  33. frmDataTransfers.lblTransferInfoDownLoad.Caption = "Dosya Çekildi " & xOnlyFileName
  34. frmDataTransfers.lblTransferInfoDownLoad.Refresh
  35.  
  36. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement