Advertisement
Guest User

Untitled

a guest
Dec 29th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. Public Class FileSharingForm
  2. Private FTPDownloader As New Utilities.FTP.FTPclient
  3.  
  4. Private Sub FileSharingForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  5. btnChangeDirectory.Enabled = False
  6. FTPDownloader.Hostname = txtServer.Text.Trim
  7. FTPDownloader.Username = txtUsername.Text
  8. FTPDownloader.Password = txtPassword.Text
  9. End Sub
  10.  
  11. Private Sub btnHomeDirectory_Click(sender As Object, e As EventArgs) Handles btnHomeDirectory.Click
  12. FTPDownloader.CurrentDirectory = "/"
  13. RefreshList()
  14. End Sub
  15.  
  16. 'important: add items to listbox
  17. Private Sub RefreshList()
  18. ListFTPFiles.Items.Clear()
  19. Try
  20. For Each file In FTPDownloader.ListDirectoryDetail()
  21. ListFTPFiles.Items.Add(file.Filename)
  22. Next
  23. Catch ex As Exception
  24. MessageBox.Show(ex.Message)
  25. End Try
  26. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement