C# Класс System.Net.FtpControlStream

Наследование: CommandStream
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AbortConnect void
AcceptCallback void
ConnectCallback void
CreateFtpListenerSocket void
FormatAddress String
FormatAddressV6 string
FormatFtpCommand string
FtpControlStream System.Collections
GetContentLengthFrom213Response long
GetLastModifiedFrom213Response System.DateTime
GetLoginDirectory string
GetPathInfo void
GetPortCommandLine string
GetPortV4 int
GetPortV6 int
IsFtpDataStreamWriteable TriState
QueueOrCreateDataConection PipelineInstruction
QueueOrCreateFtpDataStream PipelineInstruction
Quit void
SSLHandshakeCallback void
TryUpdateContentLength void
TryUpdateResponseUri void

Защищенные методы

Метод Описание
BuildCommandsList ( WebRequest req ) : PipelineEntry[]

Creates an array of commands, that will be sent to the server

CheckValid ( ResponseDescription response, int &validThrough, int &completeLength ) : bool
ClearState ( ) : void
CreateFtpDataSocket ( FtpWebRequest request, Socket templateSocket ) : Socket

This will handle either connecting to a port or listening for one

PipelineCallback ( PipelineEntry entry, ResponseDescription response, bool timeout, Stream &stream ) : PipelineInstruction

Приватные методы

Метод Описание
AbortConnect ( ) : void

Closes the connecting socket to generate an error.

AcceptCallback ( IAsyncResult asyncResult ) : void

Provides a wrapper for the async accept operations

ConnectCallback ( IAsyncResult asyncResult ) : void

Provides a wrapper for the async accept operations

CreateFtpListenerSocket ( FtpWebRequest request ) : void

Creates the Listener socket

FormatAddress ( IPAddress address, int Port ) : String

Formats an IP address (contained in a UInt32) to a FTP style command string

FormatAddressV6 ( IPAddress address, int port ) : string

Formats an IP address (v6) to a FTP style command string Looks something in this form: |2|1080::8:800:200C:417A|5282|

|2|4567::0123:5678:0123:5678|0123|

FormatFtpCommand ( string command, string parameter ) : string

Formats a simple FTP command + parameter in correct pre-wire format

FtpControlStream ( TcpClient client ) : System.Collections
GetContentLengthFrom213Response ( string responseString ) : long

Parses a response string for content length

GetLastModifiedFrom213Response ( string str ) : System.DateTime

Parses a response string for last modified time

GetLoginDirectory ( string str ) : string

Parses a response string for our login dir in " "

GetPathInfo ( GetPathOption pathOption, Uri uri, string &path, string &directory, string &filename ) : void

Gets the path component of the Uri

GetPortCommandLine ( FtpWebRequest request ) : string

Builds a command line to send to the server with proper port and IP address of client

GetPortV4 ( string responseString ) : int

Parses a response string for a port number

GetPortV6 ( string responseString ) : int

Parses a response string for a port number

IsFtpDataStreamWriteable ( ) : TriState

Determnines whether the stream we return is Writeable or Readable

QueueOrCreateDataConection ( PipelineEntry entry, ResponseDescription response, bool timeout, Stream &stream, bool &isSocketReady ) : PipelineInstruction
QueueOrCreateFtpDataStream ( Stream &stream ) : PipelineInstruction
Quit ( ) : void
SSLHandshakeCallback ( IAsyncResult asyncResult ) : void
TryUpdateContentLength ( string str ) : void

Parses a response string for content length

TryUpdateResponseUri ( string str, FtpWebRequest request ) : void

Attempts to find the response Uri Typical string looks like this, need to get trailing filename "150 Opening BINARY mode data connection for FTP46.tmp."

Описание методов

BuildCommandsList() защищенный метод

Creates an array of commands, that will be sent to the server

protected BuildCommandsList ( WebRequest req ) : PipelineEntry[]
req WebRequest
Результат PipelineEntry[]

CheckValid() защищенный метод

protected CheckValid ( ResponseDescription response, int &validThrough, int &completeLength ) : bool
response ResponseDescription
validThrough int
completeLength int
Результат bool

ClearState() защищенный метод

protected ClearState ( ) : void
Результат void

CreateFtpDataSocket() защищенный метод

This will handle either connecting to a port or listening for one

protected CreateFtpDataSocket ( FtpWebRequest request, Socket templateSocket ) : Socket
request FtpWebRequest
templateSocket Socket
Результат Socket

PipelineCallback() защищенный метод

protected PipelineCallback ( PipelineEntry entry, ResponseDescription response, bool timeout, Stream &stream ) : PipelineInstruction
entry PipelineEntry
response ResponseDescription
timeout bool
stream Stream
Результат PipelineInstruction