WebRequestMethods.Ftp Class
.NET Framework 4
Represents the types of FTP protocol methods that can be used with an FTP request. This class cannot be inherited.
Namespace:
System.Net
Assembly: System (in System.dll)
The WebRequestMethods.Ftp type exposes the following members.
| Name | Description | |
|---|---|---|
|
AppendFile | Represents the FTP APPE protocol method that is used to append a file to an existing file on an FTP server. |
|
DeleteFile | Represents the FTP DELE protocol method that is used to delete a file on an FTP server. |
|
DownloadFile | Represents the FTP RETR protocol method that is used to download a file from an FTP server. |
|
GetDateTimestamp | Represents the FTP MDTM protocol method that is used to retrieve the date-time stamp from a file on an FTP server. |
|
GetFileSize | Represents the FTP SIZE protocol method that is used to retrieve the size of a file on an FTP server. |
|
ListDirectory | Represents the FTP NLIST protocol method that gets a short listing of the files on an FTP server. |
|
ListDirectoryDetails | Represents the FTP LIST protocol method that gets a detailed listing of the files on an FTP server. |
|
MakeDirectory | Represents the FTP MKD protocol method creates a directory on an FTP server. |
|
PrintWorkingDirectory | Represents the FTP PWD protocol method that prints the name of the current working directory. |
|
RemoveDirectory | Represents the FTP RMD protocol method that removes a directory. |
|
Rename | Represents the FTP RENAME protocol method that renames a directory. |
|
UploadFile | Represents the FTP STOR protocol method that uploads a file to an FTP server. |
|
UploadFileWithUniqueName | Represents the FTP STOU protocol that uploads a file with a unique name to an FTP server. |
The members of this class can be used to set the Method property that determines the protocol method that is to be used to perform a requested action, such as uploading or downloading a file.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Simple connection check
Can you add a method to check if a connection can be made.
The simplest way to test a connection is to use PrintWorkingDirectory, which means you get a double request to the server like so
Request: PWD
Response: 257 "/Home/"
Request: PWD
Response: 257 "/Home/"
The simplest way to test a connection is to use PrintWorkingDirectory, which means you get a double request to the server like so
Request: PWD
Response: 257 "/Home/"
Request: PWD
Response: 257 "/Home/"
- 11/2/2011
- Xian - ITManx
- 11/2/2011
- Xian - ITManx
MLSD ?
Please implement MLSD ! Without it, getting a real detailed file list is impossible... I had to write a custom FTP class because of this.
- 10/11/2011
- c.lambin
MLSD ?
Please implement MLSD ! Without it, getting a real detailed file list is impossible... I had to write a custom FTP class because of this.
- 10/11/2011
- c.lambin
Missing Methods
Add support for EVERY command in the protocol, not just a hand-picked few that work for IIS.
Not all systems support "NLST" but may support "LS"
Not all systems support "NLST" but may support "LS"
- 8/18/2011
- MrGadget1024