Get the list of all document from ftp server

  •  Dim request As FtpWebRequest = WebRequest.Create(txt_ftpurl.Text)  '  you ftp url path

      request.Credentials = New NetworkCredential(txt_username.Text, txt_password.Text)  ' ftp credentials 

    request.Method = WebRequestMethods.Ftp.ListDirectory
    Dim str As New StreamReader(request.GetResponse().GetResponseStream())

    Dim read As String = str.ReadLine()

      While read <> ""    ' use while loop list will be maintain in multiline textbox till list end on ftp server
    TextBox1.Text += read + ControlChars.NewLine

    read = str.ReadLine()
    End While
    request = Nothing
    str = Nothing

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week