Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
6.6k views
in .NET FTP by (200 points)
I am trying to write a vb.net console application that can ftp files to my MVS Mainframe (I am trying to convert my Perl scripts to vb.net and am fairly new to .net (I've used VB6 a lot).
The FtpWebRequest object did not work with MVS so I downloaded edtftpnet to try it.
I looked at the Sample application and the documentation but I am at a loss to know how to incorporate edtftpnet into my application. Do I just copy edtFTPnet.dll to an appropriate location and add a reference to it from my project? I don't see it. Do I have to register it first?
If you have documentation that explains it, please point me in the right direction.

Thanks

Steve

5 Answers

0 votes
by (162k points)
Yes, all you need to do is copy edtFTPnet.dll to somewhere and add a reference to it in your project.
0 votes
by (51.6k points)
Just a little more information. While you can add FTPConnection to the Toolbox and drop one onto a Windows Form, you cannot drop an FTPConnection onto a Web Form. However, you can use FTPConnection in Web Form code. To do this you need to import EnterpriseDT.Net.Ftp at the top of you source-code and then create an instance of it manually in code. For example:
Imports EnterpriseDT.Net.Ftp

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim ftp As New SecureFTPConnection
        Try
            ftp.ServerAddress = ServerAddress.Text
            ftp.UserName = UserName.Text
            ftp.Password = Password.Text
            ftp.ServerDirectory = Directory.Text
            ftp.Connect()
            ... DO FTP STUFF HERE ...
        Catch ex As Exception
            ErrorMessage.Text = ex.Message
        Finally
            ftp.Close()
        End Try
    End Sub
End Class

As I said, in Windows Forms you can actually drop the FTPConnection onto the form and therefore set the properties in the Properties View, so that simplifies the code a bit.

- Hans (EnterpriseDT)
0 votes
by (200 points)
Sorry, I haven't gotten back to you, I've been remodeling my kitchen and took a couple of days off.

I am creating a vb.net console app so there are no windows forms, only modules.

I tried adding Imports EnterpriseDT.Net.Ftpn to my module and I get a warning:

Warning Namespace or type specified in the Imports 'EnterpriseDT.Net.Ftp' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

I unzipped edtftpnet.zip. Where do I need to copy the edtFTPnet.dll file to so my project will recoginze it?

Thanks.

Steve
0 votes
by (162k points)
The DLL can go anywhere, but you need to add a reference to it in your project.
0 votes
by (200 points)
I got it working. Thanks for the help.

Steve

Categories

...