Click here to Skip to main content
15,920,217 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I need just to connect ftp through C#. I am having an URI, Username and password.Without giving file name can we connect to FTP? Please help.
Posted
Updated 22-Dec-17 21:46pm

There are a number of free thierd party tools / articles that will help you achieve this -
Simple C# FTP Class[^]
Simple FTP library in C#[^]
http://ftplib.codeplex.com/[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 27-Mar-13 23:28pm    
Good links, a 5.
—SA
Abhinav S 27-Mar-13 23:39pm    
Thank you SA.
Member 9762654 28-Mar-13 0:11am    
can we just connect to ftp and display whether connected or not without giving any file name in the server?
If using 3rd-party tools is an option, you can use this FTP library for .NET to connect and transfer files. Here is the example code:

C#
// Create a new class 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 '/test.dat'.
client.UploadFile("c:\\test.dat", "/test.dat");

// ... 
 
// Disconnect.
client.Disconnect();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900