Click here to Skip to main content
15,917,061 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:

I am looking at your FTP Client code and I am getting a few issues. When I try to list the file(s) of a ftp server.
For Each file As FTPfileInfo In ftp2.ListDirectoryDetail(sRemoteDir).GetFiles()
Next file

I get a string returned with the following:
(from in ListDirectoryDetail.... Dim str As String = GetStringResponse(ftp))
<HTML> <HEAD> <TITLE>Directory listing for /out/</TITLE> </HEAD> <BODY> <h2>Current directory is /out/</h2> <br> <hr> <DD><IMG SRC=""> <A HREF="ftp://xxxxx:xxxxx111!@">..</A></DD> <DD><IMG SRC=""> <A HREF="ftp://xxxxx:xxxxx111!@">dotnet error.txt</A></DD> <DD><IMG SRC=""> <A HREF="ftp://xxxxx:xxxxx123!@">export.txt</A></DD> <hr> </BODY> </HTML>

The problem appears to be that the _ParseFormats does not cater for the above format in it's expressions. Can you shed some light on this for me? I've changed the ip's etc for security reasons.

Updated 28-May-12 4:15am

FTP has nothing to do with file types, not counting the difference between "text" and "binary" mode which is pretty much obsolete; so for almost all practical purpose "binary" should be used. This way, you can get/put files as is.

Acting as a FTP client .NET is way too simple. All you need is using the class System.Net.FtpWebRequest and related classes. Please see the description and the code sample:[^].

Share this answer
Maciej Los 28-May-12 18:07pm    
Good answer, my 5!
Sergey Alexandrovich Kryukov 28-May-12 19:10pm    
Thank you, Maciej.
Post your question to the FTP client article author for a better response, this forum is for general questions.
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