Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: FTP Client
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:
    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 28-May-12 5:05am
Edited 28-May-12 5:15am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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
  Permalink  
Comments
losmac at 28-May-12 18:07pm
   
Good answer, my 5!
SAKryukov at 28-May-12 19:10pm
   
Thank you, Maciej.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Post your question to the FTP client article author for a better response, this forum is for general questions.
  Permalink  

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

  Print Answers RSS
0 BillWoodruff 360
1 Mathew Soji 309
2 DamithSL 225
3 Afzaal Ahmad Zeeshan 202
4 Maciej Los 190
0 OriginalGriff 6,249
1 Sergey Alexandrovich Kryukov 5,853
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 3,865


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.1 | Last Updated 28 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100