• Loading...
Atp UltimateFtp
Creating a Web Application
Send comments on this topic to ATP, Inc.
Getting Started > Creating a Web Application

Glossary Item Box

This tutorial will walk you through creating a Web Application and add Ftp library to it.

Creating a new project and adding FTP library to it

  1. Start the Visual Studio .NET.
  2. From File menu, choose New, then choose Project.
  3. From the Project Creation dialog box, choose either Visual C# Projects or Visual Basic Projects then choose ASP.NET Web Application. Specify a name and a location for the project, then click OK.
    web
  4. Now add FTP library to your web application. To do this, add references to Atp.Ftp.dll, Atp.Common.dll, Atp.FileSystem.dll, Atp.NetworkSecure and Atp.Network.dll assemblies. Please see Installation instruction for C# and Installation instruction for VB.NET for more details.
  5. Now make a quick application to test. Drag a Button and a Label onto the form.
  6. Add the following code to the button "OnClick" event handler. This code is for uploading a local file to an FTP server.
    C# Copy Code
    // Create a new instance.
    Ftp client = new Ftp();
    // Connect to the FTP server.
    client.Connect("localhost");
    // Authenticate.
    client.Authenticate("test", "test");
    // Upload local file 'c:\test.dat' to the default remote directory.
    client.UploadFile("c:\\test.dat", "test.dat");
    string defaultDir = client.GetCurrentDirectory();
    label1.Text =
    string.Format("File has been successfully uploaded to '{0}'.", defaultDir);
    // Disconnect.
    client.Disconnect();
    VB.NET Copy Code
    ' Create a new instance.
    Dim client As New Ftp()
    ' Connect to the FTP server.
    client.Connect("localhost")
    ' Authenticate.
    client.Authenticate("test", "test")
    ' Upload local file 'c:\test.dat' to the default remote directory.
    client.UploadFile("c:\test.dat", "test.dat")
    Dim defaultDir As String = client.GetCurrentDirectory()
    label1.Text = String.Format("File has been successfully uploaded to '{0}'.", defaultDir)
    ' Disconnect.
    client.Disconnect()
  7. Compile and execute the application by navigating to the Debug menu and choose Start. Click the button and you should see a message indicating that the file has been successfully uploaded to your FTP server's default working directory in the label control.
Atp is a Microsoft Partner. Our components are compatible with Windows 7 and optimized for Visual Studio