FTP Client Technology Sample
This sample shows how to use methods of the FtpWebRequest and FtpWebResponse classes to upload and download files to and from an FTP server.
For information about using the samples, see the following topics:
To build the sample using the Command Prompt
Open the Command Prompt window and navigate to the CS subdirectory under the FTPSample directory. For information about required settings and the SDK Command Prompt, see How to: Set Sample Settings.
Type msbuild FTPSample.sln at the command line.
To build the sample using Visual Studio
Open Windows Explorer and navigate to the CS subdirectory under the FTPSample directory.
Double-click the icon for FTPSample.sln to open the file in Visual Studio.
In the Build menu, select Build Solution.
The application is built in the default \bin or \bin\Debug directory.
To run the sample
Navigate to the directory that contains the new executable file, using the Command Prompt window.
Type FTPSample.exe /? at the command line to get help on using this sample.
Type FTPSample.exe <FTP download URL> at the command line to download a file from an FTP server. For example, FtpSample ftp://myserver/download.txt.
Type FTPSample.exe <local file> <FTP upload URL> at the command line to upload a file to an FTP server. For example, FtpSample upload.txt ftp://myserver/upload.txt.
Type FTPSample.exe /list <FTP list URL> at the command line to list the files on an FTP server.
Note The sample builds a console application. You must launch it using the Command Prompt window to see its output.
Remarks
The sample requires relative path information. Full paths are not supported.