Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.5k views
in .NET FTP by (360 points)
Hello All.

Before I ask my question, here is a summary of what I have so far:

1) I read a post from June of '06 here that almost answered what I needed to know.
2) I d/l the free version to see how the commands were programmed, and
I watched the '5 minute ftp' video.
3) I saw how simple the commands were to retrieve the remote file listing.
(examples\FTPConnectionVB directory)
4) I am using VB.Net 2003.


:?: Now for the question:

Question: Are the rest of the ftp commands as easy to implement without the form controls?
For example: The sample does not show how to do single/multiple file transfers, deletions,
directory changes and so on. This looks like what I might be looking for and under $100 is
priced the right way too.

The reason for my question is I want the ftp portion of my application to work behind the
scenes without any user intervention whatsoever. All connection data is to be hard-coded.

Thanks in advance,

A. Dalton

6 Answers

0 votes
by (51.6k points)
Hi

Yes, the visual controls in edtFTPnet/Express are built on a set of non-visual components that are fully accessible to developers. They have evolved over several years, and are very comprehensive and stable. The trial comes with an application called Example Viewer which has a set of How To's that illustrate how the non-visual components are used. There's also extensive help system that is fully integrated with Visual Studio. The main non-visual FTP component in edtFTPnet/Express is ExFTPConnection. You can view its documentation here.

Does this tell you what you wanted to know?

- Hans (EDT)
0 votes
by (360 points)
Thanks for the quick answer...

The short answer is 'Yes' and 'No'.
(In the meantime I have now bought a license for edtFTPnet/Express)

While there are methods listed at the link you gave, they do not appear to have visual basic sample coding for each one. The sample program seem to relate directly to the forms, which I have no use for whatsovever. I need to code it in console.... Do you have a console-type sample as well? If there was one in the Dist. of 'dtFTPnet/Express' I must have missed it.

I tried to recreate the sample program 'BothFileLists', but was not able to copy and paste the code into a new form successfully, as there were errors generated on build To reair this issue I had to locate the duplicate sections introduced when copying your sample code into the application. Adding the controls was a whole other issue. It generated duplicate code to what I had just pasted from your sample.

=============================
1) duplicate references (per error box)
(i.e. Private components As System.ComponentModel.IContainer)

2) 'obsolete' calls (per error box)
(i.e. Me.FtpLocalFileList1.LocalWorkingDirectory = "C:\" The fix is to use 'FTPConnection.LocalDirectory') When I changed it, The entire section threw errors at me.

3) The subs 'ftpConnection_Closed' and 'ftpConnection_Connected' do not modify the Button1.Text property. They do not appear to even get processed. (I inserted a breakpoint and it never stopped.)
0 votes
by (51.6k points)
Thank you very much for your purchase.

While the help-file does not have examples in Visual Basic, the Example Viewer does. For example, in the following screenshot, the VB code for the "How to get a directory listing" is available by selecting the "VB Code" tab:
[ img ]
Likewise, each of the other How To examples should also have an associated VB listing.

Do you see the How To examples?

As for recreating the BothFileLists example. I just tried this both in VS 2003 and VS 2005. While it worked in VS 2003, I did get the errors you described in VS 2005. The reason for the errors I got is that VS 2005 places it designer-generate code in a separate file called MyForm.Designer.vb. The second components declaration was in there.

Instead of proceding in this way, I suggest starting with the tutorial in the edtFTPnet/Express help topic, Getting Started -> Quick Start with VS.NET 2005, and then moving onto the How To's which you can find in the topic Using edtFTPnet/Express -> How to...

I assume of course that you are able to view the help. Can you view the help? It is available either from Visual Studio or by selecting the "edtFTPnet Express Help" item from the edtFTPnet Express start menu.

- Hans (EDT)
0 votes
by (360 points)
Ok. I appreciate your quick response. I found the 'connection' sample, and crated a small form with a button to execute the connection routine. (I copied your example code directly)

I get the following two errors:

C:\frmWebsitePageMaker.vb(118): Method 'btnRun_Click' cannot handle Event 'Click' because they do not have the same signature.

C:\frmWebsitePageMaker.vb(120): Type 'ExFTPConnection' is not defined.

--------------
In my solution explorer, I have the 'edtFTPnetEx' and the 'SHDocVw' references.

Here is the code I am trying to use:
=============================================================================

Public Class frmWebsitePageMaker

Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "
// Snipped// <- I made no changes
#End Region

Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
Me.Close()
End Sub


Private Sub btnRun_Click(ByVal serverAddress As String, ByVal serverPort As Integer, ByVal userName As String, ByVal password As String) Handles btnRun.Click
' Instantiate ExFTPConnection
Dim ftpConnection As New ExFTPConnection

' setting server address and credentials
ftpConnection.ServerAddress = ftp.microsoft.com
ftpConnection.ServerPort = 21
ftpConnection.UserName = anonymous
ftpConnection.Password = edtFTPnetEx

' connect to the server
' By default, auto-login is on so Login doesn't need to be called
PrintLine(("Connecting to server " & serverAddress))
ftpConnection.Connect()

' get the current working directory and files
PrintLine(("Working directory is " & ftpConnection.ServerDirectory))

' Shut down client
PrintLine("Closing client")
ftpConnection.Close()

PrintLine("Example complete")
End Sub
End Class

======================================================================

Clearly I am missing something..
:?: :?:
A. Dalton
0 votes
by (162k points)
Try using EnterpriseDT.Net.Ftp.ExFTPConnection rather than ExFTPConnection, or "Imports EnterpriseDT.Net.Ftp".

Re btnRun_Click, you will need the same signature as the Click event, e.g.

Private Sub btnRun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
0 votes
by (360 points)
Imports EnterpriseDT.Net.Ftp

Worked perfectly!!

Thanks Bruce!!

Categories

...