FtpWebRequest Class
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Implements a File Transfer Protocol (FTP) client.
Inheritance Hierarchy
System. . :: . .Object
System. . :: . .MarshalByRefObject
System.Net. . :: . .WebRequest
System.Net..::..FtpWebRequest
Namespace: System.Net
Assembly: System.Ftp (in System.Ftp.dll)
Syntax
'Declaration
Public Class FtpWebRequest _
Inherits WebRequest
public class FtpWebRequest : WebRequest
public ref class FtpWebRequest : public WebRequest
type FtpWebRequest =
class
inherit WebRequest
end
public class FtpWebRequest extends WebRequest
The FtpWebRequest type exposes the following members.
Properties
Name | Description | |
---|---|---|
ConnectionGroupName | When overridden in a descendant class, gets or sets the name of the connection group for the request. (Inherited from WebRequest.) | |
ContentLength | When overridden in a descendant class, gets or sets the content length of the request data being sent. (Inherited from WebRequest.) | |
ContentType | When overridden in a descendant class, gets or sets the content type of the request data being sent. (Inherited from WebRequest.) | |
Credentials | Gets or sets the credentials used to communicate with the FTP server. | |
Headers | When overridden in a descendant class, gets or sets the collection of header name/value pairs associated with the request. (Inherited from WebRequest.) | |
Method | Gets or sets the command to send to the FTP server. (Overrides WebRequest. . :: . .Method.) | |
Proxy | When overridden in a descendant class, gets or sets the network proxy to use to access this Internet resource. (Inherited from WebRequest.) | |
RenameTo | Gets or sets the new name of a file being renamed. | |
RequestUri | When overridden in a descendant class, gets the URI of the Internet resource associated with the request. (Inherited from WebRequest.) | |
Timeout | Gets or sets the length of time, in milliseconds, before the request times out. (Inherited from WebRequest.) | |
UsePassive | Gets or sets the behavior of a client application's data transfer process. |
Top
Methods
Name | Description | |
---|---|---|
Dispose() () () () | Releases the resources used by the HttpWebRequest. (Inherited from WebRequest.) | |
Dispose(Boolean) | Releases the unmanaged resources used by the HttpWebRequest and optionally releases the managed resources. (Inherited from WebRequest.) | |
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Performs clean up operations. (Inherited from WebRequest.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetRequestStream | Retrieves the stream used to upload data to an FTP server. (Overrides WebRequest. . :: . .GetRequestStream() () () ().) | |
GetResponse | Returns the FTP server response. (Overrides WebRequest. . :: . .GetResponse() () () ().) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Fields
Name | Description | |
---|---|---|
DataSocketReady | Indicates whether the data transmission has started. | |
FTPActiveAddress | Contains the active address. | |
FTPActivePort | Contains the active port. | |
RequestPath | Contains the request path. | |
ServerIP | Contains the IP address of the server. | |
ServerPort | Contains the port number of the server. | |
TransmissionFinished | Indicates whether the data transmission has finished. |
Top
Remarks
To obtain an instance of FtpWebRequest, use the Create method.
You must have a valid user name and password for the server or the server must allow anonymous logon. You can specify the credentials used to connect to the server by setting the Credentials property.
Specify the FTP command to send to the server by setting the Method property to a value defined in the WebRequestMethods..::..Ftp structure.
Requests are sent to the server by calling the GetResponse method. When the requested operation completes, an FtpWebResponse object is returned. The FtpWebResponse object provides the status of the operation and any data downloaded from the server.
When downloading a file from an FTP server, if the command was successful, the contents of the requested file are available in the response object's stream. You can access this stream by calling the GetResponseStream method. For more information, see FtpWebResponse.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.