473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dart PowerFTP File Transfer Error

Hello Gurus

I can't get Dart PowerFTP to do anything. I create the
ftp oblect and set the connection values, but when I do a
get, put or even an invoke for a site command, I always
get the error message "No more results can be returned by
WSALookupServiceNext."

If anyone could give me some advice either about this
problem or where to ask this question, I would apreciate
it.

Here is the code I am using
Public Function TransferFiles() As Boolean
Dim DartFTP As New Dart.PowerTCP.Ftp.Ftp()
Dim StartTime, EndTime, NetTime As Double
Dim DartFTPResults As FtpFile
Dim intBytes As Integer
dim strHostName, strUsername, strPassword As String

strHostName = "ISTPFTP.STATE.WI.US"
strUsername = "JX9256"
strPassword = "CRESTEST"

Dim strErrorMsg, strSiteCommand As String

swrXferLog.WriteLine(" ")
swrXferLog.WriteLine(" ")
swrXferLog.WriteLine("NOW TRANSFER THE FILES")

Try
'set connection values
With DartFTP
DartFTP.Server = strHostName.ToString
DartFTP.Username = strUserName.ToString
DartFTP.Password = strPassword.ToString
DartFTP.Passive = False
End With
blnTransferAborted = False
StartTime = Now.Ticks

swrXferLog.WriteLine(" ")
swrXferLog.WriteLine("Connection values set")
swrXferLog.WriteLine(" Server=" &
DartFTP.Server)
swrXferLog.WriteLine(" Username=" &
DartFTP.Username)
swrXferLog.WriteLine(" Password=" &
DartFTP.Password)
swrXferLog.WriteLine(" ")
Dim fRec As New sFileRec()
Dim strMF1, strPC1, strDCB1, strDir1 As String
Dim intSub As Integer
For intSub = 1 To intFileCount
fRec = FileArray(intSub - 1)
strMF1 = "'" & fRec.MFfilename & "'"
strPC1 = fRec.PCfilename
strDCB1 = fRec.DCBinfo
strDir1 = fRec.UpOrDown
swrXferLog.WriteLine(" ")
swrXferLog.WriteLine(" File " &
intSub.ToString)
swrXferLog.WriteLine(" MF: " & strMF1)
swrXferLog.WriteLine(" PC: " & strPC1)

If strDir1 = "Upload" Then
strSiteCommand = FormatSiteCommand
(strDCB1)
swrXferLog.WriteLine(" DCB: " &
strSiteCommand)
swrXferLog.WriteLine(" ")
'DartFTP.Invoke
(FtpCommand.SiteParameters, strSiteCommand)
'DartFTPResults = DartFTP.Put(strMF1,
strPC1)
swrXferLog.WriteLine("Upload file #" &
intSub.ToString)
swrXferLog.WriteLine(" From " &
strPC1)
swrXferLog.WriteLine(" To " &
strMF1)
swrXferLog.WriteLine(" DCB " &
strSiteCommand)
Else
DartFTPResults = DartFTP.Get(strMF1,
strPC1)
'DartFTP.Get(strMF1, strPC1)
swrXferLog.WriteLine("Download file #"
& intSub.ToString)
swrXferLog.WriteLine(" From " &
strMF1)
swrXferLog.WriteLine(" To " &
strPC1)
swrXferLog.WriteLine(" From " &
DartFTPResults.RemoteFileName)
swrXferLog.WriteLine(" To " &
DartFTPResults.LocalFileName)
swrXferLog.WriteLine(" Bytes " &
DartFTPResults.Count)
End If

Next

EndTime = Now.Ticks
NetTime = (EndTime - StartTime) / 10000000
Catch ex As Exception
swrXferLog.WriteLine(" ")
strErrorMsg = ex.Message
swrXferLog.WriteLine(" ErrorMsg: " &
strErrorMsg)
strErrorMsg = ex.Source
swrXferLog.WriteLine(" ErrorSrc: " &
strErrorMsg)
blnTransferAborted = True
End Try

If DartFTP.Connected Then
DartFTP.Close()
End If

Dim strNow As String
swrXferLog.WriteLine(" ")
strNow = Now.ToString("MM/dd/yy hh:mm:ss")
If blnTransferAborted Then
swrXferLog.WriteLine(strNow & " Error: " &
strErrorMsg)
Else
swrXferLog.WriteLine(strNow & " File
transfer completed successfully")
End If
swrXferLog.Close()
Return Not blnTransferAborted

End Function
Jul 21 '05 #1
1 3668
That's a Winsock Error, not necessarily related to Dart.
http://groups.yahoo.com/group/vcpphe.../7606?source=1

http://msdn.microsoft.com/library/de...vicenext_2.asp
I use Dart and it's always been very reliable... There are a lot of risky
operations in your code (risky being defined as things can go wrong that
aren't your code's fault. ) Which line is it failing on? Can you Put to
the server?
Here's a typical snippet I use...(I have the permission properties set
already) However, try catching the specific Dart Exceptions instead of
System.Exception, it should give you a hint to what's happening.

Try

Dim fp As FtpFile = Ftp1.Put(s, Me.Path & shortName)

If File.Exists(modMain.ArchiveDirectory & shortName) Then

File.Delete(modMain.ArchiveDirectory & shortName)

End If

If File.Exists(s) Then File.Move(s, modMain.ArchiveDirectory & shortName)

Me.LogTransmission(modMain.ArchiveDirectory & shortName, 1)

Catch ex As Dart.PowerTCP.SecureFtp.ProtocolException ' or you coud trap
busy

Debug.WriteLine("SecureFTP Exception: " & ex.ToString)

Me.LogTransmission(modMain.ArchiveDirectory & shortName, 0)

Finally

Ftp1.Close()

End Try

"Eric Cory" <er*******@dwd.state.wi.us> wrote in message
news:45****************************@phx.gbl...
Hello Gurus

I can't get Dart PowerFTP to do anything. I create the
ftp oblect and set the connection values, but when I do a
get, put or even an invoke for a site command, I always
get the error message "No more results can be returned by
WSALookupServiceNext."

If anyone could give me some advice either about this
problem or where to ask this question, I would apreciate
it.

Here is the code I am using
Public Function TransferFiles() As Boolean
Dim DartFTP As New Dart.PowerTCP.Ftp.Ftp()
Dim StartTime, EndTime, NetTime As Double
Dim DartFTPResults As FtpFile
Dim intBytes As Integer
dim strHostName, strUsername, strPassword As String

strHostName = "ISTPFTP.STATE.WI.US"
strUsername = "JX9256"
strPassword = "CRESTEST"

Dim strErrorMsg, strSiteCommand As String

swrXferLog.WriteLine(" ")
swrXferLog.WriteLine(" ")
swrXferLog.WriteLine("NOW TRANSFER THE FILES")

Try
'set connection values
With DartFTP
DartFTP.Server = strHostName.ToString
DartFTP.Username = strUserName.ToString
DartFTP.Password = strPassword.ToString
DartFTP.Passive = False
End With
blnTransferAborted = False
StartTime = Now.Ticks

swrXferLog.WriteLine(" ")
swrXferLog.WriteLine("Connection values set")
swrXferLog.WriteLine(" Server=" &
DartFTP.Server)
swrXferLog.WriteLine(" Username=" &
DartFTP.Username)
swrXferLog.WriteLine(" Password=" &
DartFTP.Password)
swrXferLog.WriteLine(" ")
Dim fRec As New sFileRec()
Dim strMF1, strPC1, strDCB1, strDir1 As String
Dim intSub As Integer
For intSub = 1 To intFileCount
fRec = FileArray(intSub - 1)
strMF1 = "'" & fRec.MFfilename & "'"
strPC1 = fRec.PCfilename
strDCB1 = fRec.DCBinfo
strDir1 = fRec.UpOrDown
swrXferLog.WriteLine(" ")
swrXferLog.WriteLine(" File " &
intSub.ToString)
swrXferLog.WriteLine(" MF: " & strMF1)
swrXferLog.WriteLine(" PC: " & strPC1)

If strDir1 = "Upload" Then
strSiteCommand = FormatSiteCommand
(strDCB1)
swrXferLog.WriteLine(" DCB: " &
strSiteCommand)
swrXferLog.WriteLine(" ")
'DartFTP.Invoke
(FtpCommand.SiteParameters, strSiteCommand)
'DartFTPResults = DartFTP.Put(strMF1,
strPC1)
swrXferLog.WriteLine("Upload file #" &
intSub.ToString)
swrXferLog.WriteLine(" From " &
strPC1)
swrXferLog.WriteLine(" To " &
strMF1)
swrXferLog.WriteLine(" DCB " &
strSiteCommand)
Else
DartFTPResults = DartFTP.Get(strMF1,
strPC1)
'DartFTP.Get(strMF1, strPC1)
swrXferLog.WriteLine("Download file #"
& intSub.ToString)
swrXferLog.WriteLine(" From " &
strMF1)
swrXferLog.WriteLine(" To " &
strPC1)
swrXferLog.WriteLine(" From " &
DartFTPResults.RemoteFileName)
swrXferLog.WriteLine(" To " &
DartFTPResults.LocalFileName)
swrXferLog.WriteLine(" Bytes " &
DartFTPResults.Count)
End If

Next

EndTime = Now.Ticks
NetTime = (EndTime - StartTime) / 10000000
Catch ex As Exception
swrXferLog.WriteLine(" ")
strErrorMsg = ex.Message
swrXferLog.WriteLine(" ErrorMsg: " &
strErrorMsg)
strErrorMsg = ex.Source
swrXferLog.WriteLine(" ErrorSrc: " &
strErrorMsg)
blnTransferAborted = True
End Try

If DartFTP.Connected Then
DartFTP.Close()
End If

Dim strNow As String
swrXferLog.WriteLine(" ")
strNow = Now.ToString("MM/dd/yy hh:mm:ss")
If blnTransferAborted Then
swrXferLog.WriteLine(strNow & " Error: " &
strErrorMsg)
Else
swrXferLog.WriteLine(strNow & " File
transfer completed successfully")
End If
swrXferLog.Close()
Return Not blnTransferAborted

End Function

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: clintonG | last post by:
After the last six days trying to download VS2005 Professional it seems there may be a problem with my instance of the File Transfer Manager (FTM) or somewhere in the network in between. I can't...
8
by: Xarky | last post by:
Hi, I am downloading a GIF file(as a mail attachement) with this file format, Content-Transfer-Encoding: base64; Now I am writing the downloaded data to a file with this technique: ...
6
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked...
1
by: Irfan Akram | last post by:
Hey where can I get the library Dart.PowerWEB.LiveControls from ? Thanks, I.A "Jeff @ Dart" wrote: > If you are considering commercial solutions, check this.... >
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
1
by: Eric Cory | last post by:
Hello Gurus I can't get Dart PowerFTP to do anything. I create the ftp oblect and set the connection values, but when I do a get, put or even an invoke for a site command, I always get the...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
6
by: half.italian | last post by:
Hi all, I'm using ftplib to transfer large files to remote sites. The process seems to work perfectly with small files, but when the file gets to large ~20GB I begin getting errors that...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.