tags:

views:

156

answers:

3

I am trying to create a ftp server in c#. This server should listen to any ftp requests, and if a file is sent from a remote location, then the server should write it to a specific folder. I am using VS2008. Do I need a tcp listener? FtpWebRequest? FtpWebResponse?

+4  A: 

Don't know if writing your own FTP server is the way to go here.

Wouldn't it be easier to install a pre-rolled FTP server, and have a job that polls your FTP upload directory? This job will identify incoming files and then places them where you need based on a set of predefined rules.

Paul Alan Taylor
Thanks.Yes, this is the easier solution, but I'd prefere to have my own ftp listener. I need to log all the traffic, so using other third-party app's log would be unprofessional.
phm
Oh yeah, it is unprofessional to use existing apps, cause no ftp server out there implements some logging mechanism. It's much easier to write a complete new ftp server then a program that transform the logfile of a good running ftp server into the format i like to.
Oliver
Oliver, I asked about .net technologies that could help me in building that ftp server. I don't want to parse log files and make my own logs. lol
phm
+1  A: 

Can't you extend IIS ftp service? For example: http://learn.iis.net/page.aspx/673/how-to-use-managed-code-c-to-create-an-ftp-authentication-provider-with-dynamic-ip-restrictions/

Or as you asked: http://learn.iis.net/page.aspx/579/advanced-logging-for-iis-70---custom-logging/

jmservera
No, I don't have access to IIS. It is disabled by customer. Thanks for the idea anyway.
phm
+1  A: 

I believe a TcpListener would be easiest to work with

There's an old article on it here that should still be usefull: codeguru

Don