I attempting to download 6 files from my FTP site to a local server using VB 2008.
After 1 or 2 files are downloaded I am geeting an error Bad sequence of commands.
It appears the ftp connection is not closing then re-opening.
Here's what me code looks like:
struri = "ftp://www.ansintech.com/public_ftp/SOSDownload/TEST.exe"
strdestinationname = Me.TXTCompanyFolder.Text & "\TEST.exe"
StrUserName = "xxxxx"
StrPassWord = "xxxxxxxxx"
Me.Cursor = Cursors.WaitCursor
LBLFileName.Text = "File 2 of 6"
My.Computer.Network.DownloadFile(struri, strdestinationname, StrUserName, StrPassWord, True, 100, True, FileIO.UICancelOption.ThrowException)
Then I change the file name. After the 2nd or 3rd file, I get the error message.
How would I close the connection and reopen it without having to close the program?
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?