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
- Start the Visual Studio .NET.
- From File menu, choose New, then choose Project.
- 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.
- Now add FTP library to your web application. To do this, add references to ComponentPro.Ftp.dll, ComponentPro.Common.dll, ComponentPro.FileSystem.dll, and ComponentPro.Network.dll assemblies. Please see Installation instruction for C# and Installation instruction for VB.NET for more details.
- Now make a quick application to test. Drag a Button and a Label onto the form.
- Add the following code to the button "OnClick" event handler. This code is for uploading a local file to an FTP server.
// Create a new class instance.
Ftp client = new Ftp();
// Connect to the FTP server.
// Upload local file 'c:\test.dat' to '/test.dat'.
- 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.