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:
Hi,

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.
From Vb.net:
VB
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="http://10.142.10.100:80/http://-internal-/02ea93086b12/menu.gif"> <A HREF="ftp://xxxxx:xxxxx111!@101.101.11.111/">..</A></DD> <DD><IMG SRC="http://10.142.10.100:80/http://-internal-/02ea93086b12/text.gif"> <A HREF="ftp://xxxxx:xxxxx111!@101.101.11.111/out/dotnet%20error.txt">dotnet error.txt</A></DD> <DD><IMG SRC="http://10.142.10.100:80/http://-internal-/02ea93086b12/text.gif"> <A HREF="ftp://xxxxx:xxxxx123!@101.101.11.111/out/export.txt">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.

Rgds
Posted
Updated 28-May-12 4:15am
v2

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:
http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx[^].

—SA
 
Share this answer
 
Comments
Maciej Los 28-May-12 18:07pm    
Good answer, my 5!
Sergey Alexandrovich Kryukov 28-May-12 19:10pm    
Thank you, Maciej.
--SA
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