Ftp Session
Represents an FTP session on the server. The FTP server uses sessions to manage access to the filesystem. Each session represents a client connection context for file operations and provides access to an underlying stream.
Use case
FtpServerEx uses sessions by default, but you can implement your own FTP server logic and use FtpSession directly.
Create a session and open it.
Open a file and get a stream from it.
Now you can use the session to get access to the file and do some work with it.
When you are done with the file, close the session.
Api
SessionMode
Specifies the mode of the FTP session.
Value | Description |
|---|---|
| The session is free and not in use. |
| The session mode is unknown. |
| The session is opened for reading. |
| The session is opened for writing. |
| The session is opened for both reading and writing. |
FtpSession
Property | Type | Description |
|---|---|---|
|
| Gets or sets the data stream associated with the session. |
|
| Gets the session identifier. |
|
| Gets the current mode of the session. |
Method | Return Type | Description |
|---|---|---|
|
| Opens the session with the specified mode. |
|
| Closes the session and disposes of resources. |
|
| Asynchronously closes the session and disposes of resources. |
FtpSession.Open
Parameter | Type | Description |
|---|---|---|
|
| The mode to open the session in. |