The SftpClient type exposes the following members.

Constructors

  NameDescription
Public methodSftpClient(ConnectionInfo)
Initializes a new instance of the SftpClient class.
Public methodSftpClient(String, String, array<PrivateKeyFile>[]()[][])
Initializes a new instance of the SftpClient class.
Public methodSftpClient(String, String, String)
Initializes a new instance of the SftpClient class.
Public methodSftpClient(String, Int32, String, array<PrivateKeyFile>[]()[][])
Initializes a new instance of the SftpClient class.
Public methodSftpClient(String, Int32, String, String)
Initializes a new instance of the SftpClient class.

Methods

  NameDescription
Public methodAppendAllLines(String, IEnumerable<(Of <<'(String>)>>))
Appends lines to a file, and then closes the file.
Public methodAppendAllLines(String, IEnumerable<(Of <<'(String>)>>), Encoding)
Appends lines to a file by using a specified encoding, and then closes the file.
Public methodAppendAllText(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.
Public methodAppendAllText(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.
Public methodAppendText(String)
Creates a StreamWriter that appends UTF-8 encoded text to an existing file.
Public methodAppendText(String, Encoding)
Creates a StreamWriter that appends UTF-8 encoded text to an existing file.
Public methodBeginDownloadFile(String, Stream)
Begins an asynchronous file downloading into the stream.
Public methodBeginDownloadFile(String, Stream, AsyncCallback)
Begins an asynchronous file downloading into the stream.
Public methodBeginDownloadFile(String, Stream, AsyncCallback, Object, Action<(Of <<'(UInt64>)>>))
Begins an asynchronous file downloading into the stream.
Public methodBeginListDirectory
Begins an asynchronous operation of retrieving list of files in remote directory.
Public methodBeginSynchronizeDirectories
Begins the synchronize directories.
Public methodBeginUploadFile(Stream, String)
Begins an asynchronous uploading the steam into remote file.
Public methodBeginUploadFile(Stream, String, AsyncCallback)
Begins an asynchronous uploading the steam into remote file.
Public methodBeginUploadFile(Stream, String, AsyncCallback, Object, Action<(Of <<'(UInt64>)>>))
Begins an asynchronous uploading the steam into remote file.
Public methodBeginUploadFile(Stream, String, Boolean, AsyncCallback, Object, Action<(Of <<'(UInt64>)>>))
Begins an asynchronous uploading the steam into remote file.
Public methodChangeDirectory
Changes remote directory to path.
Public methodChangePermissions
Changes permissions of file(s) to specified mode.
Public methodConnect
Connects client to the server.
(Inherited from BaseClient.)
Public methodCreate(String)
Creates or overwrites a file in the specified path.
Public methodCreate(String, Int32)
Creates or overwrites the specified file.
Public methodCreateDirectory
Creates remote directory specified by path.
Public methodCreateText(String)
Creates or opens a file for writing UTF-8 encoded text.
Public methodCreateText(String, Encoding)
Creates or opens a file for writing UTF-8 encoded text.
Public methodDelete
Deletes the specified file or directory. An exception is not thrown if the specified file does not exist.
Public methodDeleteDirectory
Deletes remote directory specified by path.
Public methodDeleteFile
Deletes remote file specified by path.
Public methodDisconnect
Disconnects client from the server.
(Inherited from BaseClient.)
Public methodDispose()()()()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged ResourceMessages.
(Inherited from BaseClient.)
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources
(Overrides BaseClient..::..Dispose(Boolean).)
Public methodDownloadFile
Downloads remote file specified by the path into the stream.
Public methodEndDownloadFile
Ends an asynchronous file downloading into the stream.
Public methodEndListDirectory
Ends an asynchronous operation of retrieving list of files in remote directory.
Public methodEndSynchronizeDirectories
Ends the synchronize directories.
Public methodEndUploadFile
Ends an asynchronous uploading the steam into remote file.
Public methodExists
Checks whether file pr directory exists;
Protected methodFinalize
Releases unmanaged resources and performs other cleanup operations before the BaseClient is reclaimed by garbage collection.
(Inherited from BaseClient.)
Public methodGet
Gets reference to remote file or directory.
Public methodGetAttributes
Gets the SftpFileAttributes of the file on the path.
Public methodGetLastAccessTime
Returns the date and time the specified file or directory was last accessed.
Public methodGetLastAccessTimeUtc
Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed.
Public methodGetLastWriteTime
Returns the date and time the specified file or directory was last written to.
Public methodGetLastWriteTimeUtc
Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to.
Public methodGetStatus
Gets status using statvfs@openssh.com request.
Public methodListDirectory
Retrieves list of files in remote directory.
Protected methodOnConnected
Called when client is connected to the server.
(Overrides BaseClient..::..OnConnected()()()().)
Protected methodOnConnecting
Called when client is connecting to the server.
(Inherited from BaseClient.)
Protected methodOnDisconnected
Called when client is disconnected from the server.
(Inherited from BaseClient.)
Protected methodOnDisconnecting
Called when client is disconnecting from the server.
(Overrides BaseClient..::..OnDisconnecting()()()().)
Public methodOpen(String, FileMode)
Opens a SftpFileStream on the specified path with read/write access.
Public methodOpen(String, FileMode, FileAccess)
Opens a SftpFileStream on the specified path, with the specified mode and access.
Public methodOpenRead
Opens an existing file for reading.
Public methodOpenText
Opens an existing UTF-8 encoded text file for reading.
Public methodOpenWrite
Opens an existing file for writing.
Public methodReadAllBytes
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
Public methodReadAllLines(String)
Opens a text file, reads all lines of the file, and then closes the file.
Public methodReadAllLines(String, Encoding)
Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
Public methodReadAllText(String)
Opens a text file, reads all lines of the file, and then closes the file.
Public methodReadAllText(String, Encoding)
Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
Public methodReadLines(String)
Reads the lines of a file.
Public methodReadLines(String, Encoding)
Read the lines of a file that has a specified encoding.
Public methodRenameFile(String, String)
Renames remote file from old path to new path.
Public methodRenameFile(String, String, Boolean)
Renames remote file from old path to new path.
Public methodSendKeepAlive
Sends keep-alive message to the server.
(Inherited from BaseClient.)
Public methodSetAttributes
Sets the specified SftpFileAttributes of the file on the specified path.
Public methodSetLastWriteTime Obsolete.
Sets the date and time that the specified file was last written to.
Public methodSetLastWriteTimeUtc Obsolete.
Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to.
Public methodSymbolicLink
Creates a symbolic link from old path to new path.
Public methodSynchronizeDirectories
Synchronizes the directories.
Public methodUploadFile(Stream, String, Action<(Of <<'(UInt64>)>>))
Uploads stream into remote file..
Public methodUploadFile(Stream, String, Boolean, Action<(Of <<'(UInt64>)>>))
Uploads stream into remote file..
Public methodWriteAllBytes
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.
Public methodWriteAllLines(String, IEnumerable<(Of <<'(String>)>>))
Creates a new file, writes a collection of strings to the file, and then closes the file.
Public methodWriteAllLines(String, array<String>[]()[][])
Creates a new file, write the specified string array to the file, and then closes the file.
Public methodWriteAllLines(String, IEnumerable<(Of <<'(String>)>>), Encoding)
Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.
Public methodWriteAllLines(String, array<String>[]()[][], Encoding)
Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file.
Public methodWriteAllText(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.
Public methodWriteAllText(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

  NameDescription
Public propertyBufferSize
Gets or sets the size of the buffer.
Public propertyIsConnected
Gets a value indicating whether this client is connected to the server.
(Inherited from BaseClient.)
Public propertyKeepAliveInterval
Gets or sets the keep alive interval in seconds.
(Inherited from BaseClient.)
Public propertyOperationTimeout
Gets or sets the operation timeout.
Public propertyProtocolVersion
Gets sftp protocol version.
Public propertyWorkingDirectory
Gets remote working directory.

Events

  NameDescription
Public eventErrorOccurred
Occurs when an error occurred.
(Inherited from BaseClient.)
Public eventHostKeyReceived
Occurs when host key received.
(Inherited from BaseClient.)

See Also