944,160 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 2545
  • VB.NET RSS
Aug 26th, 2005
0

FTP error

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mordtechin is offline Offline
2 posts
since Aug 2005
Aug 26th, 2005
0

Re: FTP error

Actually I "solved" it.

In the GetFileList Function is the following code
VB.NET Syntax (Toggle Plain Text)
  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.

VB.NET Syntax (Toggle Plain Text)
  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


:-)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mordtechin is offline Offline
2 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: closing form1 from form2
Next Thread in VB.NET Forum Timeline: ComboBox UpDate Problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC