The SftpClient type exposes the following members.
Back to Top
Back to Top
Back to Top
Back to Top
Constructors
| Name | Description | |
|---|---|---|
| SftpClient(ConnectionInfo) |
Initializes a new instance of the SftpClient class.
| |
| SftpClient(String, String, PrivateKeyFile ) |
Initializes a new instance of the SftpClient class.
| |
| SftpClient(String, String, String) |
Initializes a new instance of the SftpClient class.
| |
| SftpClient(String, Int32, String, PrivateKeyFile ) |
Initializes a new instance of the SftpClient class.
| |
| SftpClient(String, Int32, String, String) |
Initializes a new instance of the SftpClient class.
|
Methods
| Name | Description | |
|---|---|---|
| AppendAllLines(String, IEnumerable String ) |
Appends lines to a file, and then closes the file.
| |
| AppendAllLines(String, IEnumerable String , Encoding) |
Appends lines to a file by using a specified encoding, and then closes the file.
| |
| AppendAllText(String, String) |
Opens a file, appends the specified string to the file, and then closes the file.
If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
| |
| AppendAllText(String, String, Encoding) |
Opens a file, appends the specified string to the file, and then closes the file.
If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
| |
| AppendText(String) |
Creates a | |
| AppendText(String, Encoding) |
Creates a | |
| BeginDownloadFile |
Begins an asynchronous file downloading into the stream.
| |
| BeginListDirectory |
Begins an asynchronous operation of retrieving list of files in remote directory.
| |
| BeginSynchronizeDirectories |
Begins the synchronize directories.
| |
| BeginUploadFile(Stream, String, AsyncCallback, Object, Action UInt64 ) |
Begins an asynchronous uploading the steam into remote file.
| |
| BeginUploadFile(Stream, String, Boolean, AsyncCallback, Object, Action UInt64 ) |
Begins an asynchronous uploading the steam into remote file.
| |
| ChangeDirectory |
Changes remote directory to path.
| |
| ChangePermissions |
Changes permissions of file(s) to specified mode.
| |
| Connect |
Connects client to the server.
(Inherited from BaseClient.) | |
| Create(String) |
Creates or overwrites a file in the specified path.
| |
| Create(String, Int32) |
Creates or overwrites the specified file.
| |
| CreateDirectory |
Creates remote directory specified by path.
| |
| CreateText(String) |
Creates or opens a file for writing UTF-8 encoded text.
| |
| CreateText(String, Encoding) |
Creates or opens a file for writing UTF-8 encoded text.
| |
| Delete |
Deletes the specified file or directory. An exception is not thrown if the specified file does not exist.
| |
| DeleteDirectory |
Deletes remote directory specified by path.
| |
| DeleteFile |
Deletes remote file specified by path.
| |
| Disconnect |
Disconnects client from the server.
(Inherited from BaseClient.) | |
| Dispose |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged ResourceMessages.
(Inherited from BaseClient.) | |
| Dispose(Boolean) |
Releases unmanaged and - optionally - managed resources
(Overrides BaseClient Dispose(Boolean).) | |
| DownloadFile |
Downloads remote file specified by the path into the stream.
| |
| EndDownloadFile |
Ends an asynchronous file downloading into the stream.
| |
| EndListDirectory |
Ends an asynchronous operation of retrieving list of files in remote directory.
| |
| EndSynchronizeDirectories |
Ends the synchronize directories.
| |
| EndUploadFile |
Ends an asynchronous uploading the steam into remote file.
| |
| EnsureConnection |
Ensures that client is connected.
(Inherited from BaseClient.) | |
| (Inherited from | ||
| Exists |
Checks whether file pr directory exists;
| |
| Finalize |
Releases unmanaged resources and performs other cleanup operations before the
BaseClient is reclaimed by garbage collection.
(Inherited from BaseClient.) | |
| Get |
Gets reference to remote file or directory.
| |
| GetAttributes |
Gets the SftpFileAttributes of the file on the path.
| |
Serves as a hash function for a particular type. (Inherited from | ||
| GetLastAccessTime |
Returns the date and time the specified file or directory was last accessed.
| |
| GetLastAccessTimeUtc |
Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed.
| |
| GetLastWriteTime |
Returns the date and time the specified file or directory was last written to.
| |
| GetLastWriteTimeUtc |
Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to.
| |
| GetStatus |
Gets status using statvfs@openssh.com request.
| |
Gets the (Inherited from | ||
| ListDirectory |
Retrieves list of files in remote directory.
| |
Creates a shallow copy of the current (Inherited from | ||
| OnConnected |
Called when client is connected to the server.
(Overrides BaseClient OnConnected .) | |
| OnConnecting |
Called when client is connecting to the server.
(Inherited from BaseClient.) | |
| OnDisconnected |
Called when client is disconnected from the server.
(Inherited from BaseClient.) | |
| OnDisconnecting |
Called when client is disconnecting from the server.
(Overrides BaseClient OnDisconnecting .) | |
| Open(String, FileMode) |
Opens a SftpFileStream on the specified path with read/write access.
| |
| Open(String, FileMode, FileAccess) |
Opens a SftpFileStream on the specified path, with the specified mode and access.
| |
| OpenRead |
Opens an existing file for reading.
| |
| OpenText |
Opens an existing UTF-8 encoded text file for reading.
| |
| OpenWrite |
Opens an existing file for writing.
| |
| ReadAllBytes |
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
| |
| ReadAllLines(String) |
Opens a text file, reads all lines of the file, and then closes the file.
| |
| ReadAllLines(String, Encoding) |
Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
| |
| ReadAllText(String) |
Opens a text file, reads all lines of the file, and then closes the file.
| |
| ReadAllText(String, Encoding) |
Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
| |
| ReadLines(String) |
Reads the lines of a file.
| |
| ReadLines(String, Encoding) |
Read the lines of a file that has a specified encoding.
| |
| RenameFile(String, String) |
Renames remote file from old path to new path.
| |
| RenameFile(String, String, Boolean) |
Renames remote file from old path to new path.
| |
| SendKeepAlive |
Sends keep-alive message to the server.
(Inherited from BaseClient.) | |
| SetAttributes |
Sets the specified SftpFileAttributes of the file on the specified path.
| |
| SetLastAccessTime | Obsolete.
Sets the date and time the specified file was last accessed.
| |
| SetLastAccessTimeUtc | Obsolete.
Sets the date and time, in coordinated universal time (UTC), that the specified file was last accessed.
| |
| SetLastWriteTime | Obsolete.
Sets the date and time that the specified file was last written to.
| |
| SetLastWriteTimeUtc | Obsolete.
Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to.
| |
| SymbolicLink |
Creates a symbolic link from old path to new path.
| |
| SynchronizeDirectories |
Synchronizes the directories.
| |
| (Inherited from | ||
| UploadFile(Stream, String, Action UInt64 ) |
Uploads stream into remote file..
| |
| UploadFile(Stream, String, Boolean, Action UInt64 ) |
Uploads stream into remote file..
| |
| WriteAllBytes |
Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.
| |
| WriteAllLines(String, IEnumerable String ) |
Creates a new file, writes a collection of strings to the file, and then closes the file.
| |
| WriteAllLines(String, String ) |
Creates a new file, write the specified string array to the file, and then closes the file.
| |
| WriteAllLines(String, IEnumerable String , Encoding) |
Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.
| |
| WriteAllLines(String, String , Encoding) |
Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file.
| |
| WriteAllText(String, String) |
Creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten.
| |
| WriteAllText(String, String, Encoding) |
Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.
|
Properties
| Name | Description | |
|---|---|---|
| BufferSize |
Gets or sets the size of the buffer.
| |
| ConnectionInfo |
Gets the connection info.
(Inherited from BaseClient.) | |
| IsConnected |
Gets a value indicating whether this client is connected to the server.
(Inherited from BaseClient.) | |
| KeepAliveInterval |
Gets or sets the keep alive interval in seconds.
(Inherited from BaseClient.) | |
| OperationTimeout |
Gets or sets the operation timeout.
| |
| ProtocolVersion |
Gets sftp protocol version.
| |
| Session |
Gets current session.
(Inherited from BaseClient.) | |
| WorkingDirectory |
Gets remote working directory.
|
Events
| Name | Description | |
|---|---|---|
| ErrorOccurred |
Occurs when an error occurred.
(Inherited from BaseClient.) | |
| HostKeyReceived |
Occurs when host key received.
(Inherited from BaseClient.) |
See Also