FTP error

Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Aug 2005
Posts: 2
Reputation: mordtechin is an unknown quantity at this point 
Solved Threads: 0
mordtechin's Avatar
mordtechin mordtechin is offline Offline
Newbie Poster

FTP error

 
0
  #1
Aug 26th, 2005
Hello all you VB.NET 'ers

This being my first post would first of all like to say "Hallo!" :cheesy:

My problem is with Microsoft's FTP class
http://support.microsoft.com/default...b;en-us;832679

When I use this class, I am calling the
GetFileList Function to populate a listbox so that the user may be able to choose the files to download. However, it does not consistently return all the files. Usually it either 1] return only 1 file in the directory (if lots of files are in directory only returns one) 2] return all files in directory.

Has anyone had the same problem before and know how to fix this or have another FTP class that I could use to achieve this?

Thanks in advance.This should help greatly in several of the programs I need to run that need to retrieve a file from an FTP site to process and such.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 2
Reputation: mordtechin is an unknown quantity at this point 
Solved Threads: 0
mordtechin's Avatar
mordtechin mordtechin is offline Offline
Newbie Poster

Re: FTP error

 
0
  #2
Aug 26th, 2005
Actually I "solved" it.

In the GetFileList Function is the following code
  1. Do While (True)
  2. m_aBuffer.Clear(m_aBuffer, 0, m_aBuffer.Length)
  3. bytes = cSocket.Receive(m_aBuffer, m_aBuffer.Length, 0)
  4. m_sMes += ASCII.GetString(m_aBuffer, 0, bytes)
  5. If (bytes < m_aBuffer.Length) Then
  6. Exit Do
  7. End If
  8. Loop
I replaces it with the following which seems to work 100% now.

  1. Do
  2. m_aBuffer.Clear(m_aBuffer, 0, m_aBuffer.Length)
  3. bytes = cSocket.Receive(m_aBuffer)
  4. If bytes > 0 Then
  5. m_sMes += ASCII.GetString(m_aBuffer, 0, bytes)
  6. End If
  7. Loop Until bytes = 0
This snipped of code which I edited can be obtained from
http://www.mentalis.org/classlib/class.php?id=23


:-)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC