Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I going to do the list box to show all my files in the ftp server so that the user can select the files and download it. After i typed my ftp server ip address "ftp://192.168.10.1/ in the textbox then clicked the button for display all files listed in the ftp. It shows the messages invalid url : the hostname cannot be parsed. But, I can view all my files in the web browser by typing the correct ftp address. By the way, I am using the ftpclient.dll for the references from https://www.codeproject.com/Articles/11991/An-FTP-client-library-for-NET. Please help me to solve the problems or figure out other ways to doing it. Thanks for your helps.

What I have tried:

VB.NET
Public Class FileSharingForm
Private FTPDownloader As New Utilities.FTP.FTPclient

Private Sub FileSharingForm_Load(sender As Object, e As EventArgs) Handles     MyBase.Load
btnChangeDirectory.Enabled = False
FTPDownloader.Hostname = txtServer.Text.Trim
FTPDownloader.Username = txtUsername.Text
FTPDownloader.Password = txtPassword.Text

End Sub

Private Sub btnHomeDirectory_Click(sender As Object, e As EventArgs) Handles      btnHomeDirectory.Click
FTPDownloader.CurrentDirectory = /;
RefreshList()
End Sub

Private Sub RefreshList()
ListFTPFiles.Items.Clear()
Try
For Each file In FTPDownloader.ListDirectoryDetail()
    ListFTPFiles.Items.Add(file.Filename)
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

End Class
Posted
Updated 28-Dec-16 21:47pm
v2

1 solution

You should post your question in the forum at the end of the article so the author of the code sees it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900