EN
Deze inhoud is niet beschikbaar in uw taal, maar wel in het Engels.

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.

Namespace:  System.Net
Assembly:  System.Ftp (in System.Ftp.dll)

public class FtpWebRequest : WebRequest

The FtpWebRequest type exposes the following members.

  NameDescription
Public propertyConnectionGroupNameWhen overridden in a descendant class, gets or sets the name of the connection group for the request. (Inherited from WebRequest.)
Public propertyContentLengthWhen overridden in a descendant class, gets or sets the content length of the request data being sent. (Inherited from WebRequest.)
Public propertyContentTypeWhen overridden in a descendant class, gets or sets the content type of the request data being sent. (Inherited from WebRequest.)
Public propertyCredentialsGets or sets the credentials used to communicate with the FTP server.
Public propertyHeadersWhen overridden in a descendant class, gets or sets the collection of header name/value pairs associated with the request. (Inherited from WebRequest.)
Public propertyMethodGets or sets the command to send to the FTP server. (Overrides WebRequest..::..Method.)
Public propertyProxyWhen overridden in a descendant class, gets or sets the network proxy to use to access this Internet resource. (Inherited from WebRequest.)
Public propertyRenameToGets or sets the new name of a file being renamed.
Public propertyRequestUriWhen overridden in a descendant class, gets the URI of the Internet resource associated with the request. (Inherited from WebRequest.)
Public propertyTimeoutGets or sets the length of time, in milliseconds, before the request times out. (Inherited from WebRequest.)
Public propertyUsePassiveGets or sets the behavior of a client application's data transfer process.
Top

  NameDescription
Public methodDispose()()()()Releases the resources used by the HttpWebRequest. (Inherited from WebRequest.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by the HttpWebRequest and optionally releases the managed resources. (Inherited from WebRequest.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizePerforms clean up operations. (Inherited from WebRequest.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetRequestStreamRetrieves the stream used to upload data to an FTP server. (Overrides WebRequest..::..GetRequestStream()()()().)
Public methodGetResponseReturns the FTP server response. (Overrides WebRequest..::..GetResponse()()()().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public fieldDataSocketReadyIndicates whether the data transmission has started.
Public fieldFTPActiveAddressContains the active address.
Public fieldFTPActivePortContains the active port.
Public fieldRequestPathContains the request path.
Public fieldServerIPContains the IP address of the server.
Public fieldServerPortContains the port number of the server.
Public fieldTransmissionFinishedIndicates whether the data transmission has finished.
Top

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Weergeven: