Upload File to FTP Programmatically
FTP is a standards based means of transferring files from one location to another. It has been there for moving files across the Internet for quite some time. Microsoft .NET supports FTP with the out of the box implementation of
WebClient. When the
ftp://as part of the address it will internally use an
FtpWebRequestobject to perform the transfer. The following example code demonstrates how to use the
WebClientto upload a file to an FTP site.
With modifying the static void watcher_Created(object sender, FileSystemEventArgs e) event, with: