C# Class System.Net.FtpWebRequest

The FtpWebRequest class implements a basic FTP client interface.

Inheritance: WebRequest
显示文件 Open project: dotnet/corefx Class Usage Examples

Private Properties

Property Type Description
AsyncRequestCallback void
AttemptedRecovery bool
CheckError void
CreateConnection FtpControlStream
CreateConnectionAsync void
DataStreamClosed void
EnsureFtpWebResponse void
FinishRequestStage RequestStage
FtpWebRequest
FtpWebRequest System.Diagnostics
GetUserString string
RequestCallback void
SetException void
SubmitRequest void
SyncRequestCallback void
TimedSubmitRequestHelper System.IO.Stream
TimerCallback void
TranslateConnectException Exception

Public Methods

Method Description
Abort ( ) : void
BeginGetRequestStream ( AsyncCallback callback, object state ) : IAsyncResult

Used to query for the Request stream of an FTP Request [async version]

BeginGetRequestStream ( System callback, object state ) : System.IAsyncResult
BeginGetResponse ( AsyncCallback callback, object state ) : IAsyncResult

Used to query for the Response of an FTP request [async version]

BeginGetResponse ( System callback, object state ) : System.IAsyncResult
EndGetRequestStream ( IAsyncResult asyncResult ) : Stream
EndGetRequestStream ( System asyncResult ) : System.IO.Stream
EndGetResponse ( System asyncResult ) : System.Net.WebResponse
EndGetResponse ( IAsyncResult asyncResult ) : WebResponse

Returns result of query for the Response of an FTP request [async version]

GetRequestStream ( ) : Stream

Used to query for the Request stream of an FTP Request

GetRequestStream ( ) : System.IO.Stream
GetResponse ( ) : System.Net.WebResponse
GetResponse ( ) : WebResponse

Private Methods

Method Description
AsyncRequestCallback ( object obj ) : void
AttemptedRecovery ( Exception e ) : bool

Returns true if we should restart the request after an error

CheckError ( ) : void

Opposite of SetException, rethrows the exception

CreateConnection ( ) : FtpControlStream
CreateConnectionAsync ( ) : void
DataStreamClosed ( CloseExState closeState ) : void
EnsureFtpWebResponse ( Exception exception ) : void

Creates an FTP WebResponse based off the responseStream and our active Connection

FinishRequestStage ( RequestStage stage ) : RequestStage
FtpWebRequest ( )
FtpWebRequest ( Uri uri ) : System.Diagnostics
GetUserString ( ) : string

Returns username string

RequestCallback ( object obj ) : void
SetException ( Exception exception ) : void

Updates and sets our exception to be thrown

SubmitRequest ( bool isAsync ) : void
SyncRequestCallback ( object obj ) : void
TimedSubmitRequestHelper ( bool isAsync ) : Stream
TimerCallback ( TimerThread timer, int timeNoticed, object context ) : void

Because this is called from the timer thread, neither it nor any methods it calls can call user code.

TranslateConnectException ( Exception e ) : Exception

Method Details

Abort() public method

public Abort ( ) : void
return void

BeginGetRequestStream() public method

Used to query for the Request stream of an FTP Request [async version]

public BeginGetRequestStream ( AsyncCallback callback, object state ) : IAsyncResult
callback AsyncCallback
state object
return IAsyncResult

BeginGetRequestStream() public method

public BeginGetRequestStream ( System callback, object state ) : System.IAsyncResult
callback System
state object
return System.IAsyncResult

BeginGetResponse() public method

Used to query for the Response of an FTP request [async version]

public BeginGetResponse ( AsyncCallback callback, object state ) : IAsyncResult
callback AsyncCallback
state object
return IAsyncResult

BeginGetResponse() public method

public BeginGetResponse ( System callback, object state ) : System.IAsyncResult
callback System
state object
return System.IAsyncResult

EndGetRequestStream() public method

public EndGetRequestStream ( IAsyncResult asyncResult ) : Stream
asyncResult IAsyncResult
return System.IO.Stream

EndGetRequestStream() public method

public EndGetRequestStream ( System asyncResult ) : System.IO.Stream
asyncResult System
return System.IO.Stream

EndGetResponse() public method

public EndGetResponse ( System asyncResult ) : System.Net.WebResponse
asyncResult System
return System.Net.WebResponse

EndGetResponse() public method

Returns result of query for the Response of an FTP request [async version]

public EndGetResponse ( IAsyncResult asyncResult ) : WebResponse
asyncResult IAsyncResult
return WebResponse

GetRequestStream() public method

Used to query for the Request stream of an FTP Request

public GetRequestStream ( ) : Stream
return System.IO.Stream

GetRequestStream() public method

public GetRequestStream ( ) : System.IO.Stream
return System.IO.Stream

GetResponse() public method

public GetResponse ( ) : System.Net.WebResponse
return System.Net.WebResponse

GetResponse() public method

public GetResponse ( ) : WebResponse
return WebResponse