Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
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:
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.
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.
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.
The sample requires relative path information. Full paths are not supported.