FtpWebRequest Class
Namespace: Rebex.Net
Assembly: Rebex.Ftp.dll (version 7.0.9448)
Provides an FTP-specific implementation of the WebRequest class.
Syntax
public class FtpWebRequest : WebRequest, ISerializable
Implements
Inherited Members
Examples
The following example demonstrates how to use FtpWebResponse.
// Registers FtpWebRequest for the specified schema.
WebRequest.RegisterPrefix ("ftp://", FtpWebRequest.Creator);
// Creates a WebRequest for the specified URL.
WebRequest request = WebRequest.Create (url);
// Sends the WebRequest and waits for a response.
WebResponse response = request.GetResponse();
Console.WriteLine("\nResponse Received. Trying to Close the response stream...");
// Releases the resources of the response.
response.Close();
Console.WriteLine("\nResponse Stream successfully closed");
Properties
| Name | Description |
|---|---|
| ContentLength | Gets or sets the Content-length HTTP header. |
| ContentType | Gets or sets the value of the Content-type HTTP header. |
| Creator | Gets the instance of IWebRequestCreate for registering with WebRequest.Create. |
| Credentials | Gets or sets the credentials to submit to the proxy server for authentication. |
| Headers | Gets or sets a collection of the name/value pairs that make up the HTTP headers. |
| LogWriter | Gets or sets the log writer used by this object. |
| Method | Gets or sets the method for the request. |
| PreAuthenticate | Gets or sets a value indicating whether to send a preauthentication header with the request. |
| Proxy | Gets or sets proxy information for the request. |
| RequestUri | Gets the URI of the request. |
| SslMode | Gets or sets SSL mode. |
| Timeout | Gets or sets the time-out value (in milliseconds) for a request. |
| TlsParameters | Gets or sets TLS/SSL security parameters. |
Methods
| Name | Description |
|---|---|
| Abort() | Cancels an asynchronous FTP request. |
| BeginGetRequestStream(AsyncCallback, Object) | Begins an asynchronous request for a Stream instance to use to write data. |
| BeginGetResponse(AsyncCallback, Object) | Begins an asynchronous request for a FtpWebResponse instance to use to write data. |
| EndGetRequestStream(IAsyncResult) | Ends a pending asynchronous request for a Stream instance. |
| EndGetResponse(IAsyncResult) | Ends a pending asynchronous request for a FtpWebResponse instance. |
| GetRequestStream() | Gets a Stream instance to use to write request data. |
| GetResponse() | Returns WebResponse instance to use to write data. |
Events
| Name | Description |
|---|---|
| CommandSent | Occurs when a command is send to the server. |
| ResponseRead | Occurs when a response is received from the server. |