SftpClient MethodsSSH .NET Client Library Documentation
The SftpClient type exposes the following members.
Methods

  NameDescription
Public methodAppendAllLines(String, IEnumerable String )
Appends lines to a file, and then closes the file.
Public methodAppendAllLines(String, IEnumerable 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 OnlineStreamWriter that appends UTF-8 encoded text to an existing file.
Public methodAppendText(String, Encoding)
Creates a OnlineStreamWriter that appends UTF-8 encoded text to an existing file.
Public methodBeginDownloadFile
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, AsyncCallback, Object, Action UInt64 )
Begins an asynchronous uploading the steam into remote file.
Public methodBeginUploadFile(Stream, String, Boolean, AsyncCallback, Object, Action 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.
Protected methodEnsureConnection
Ensures that client is connected.
(Inherited from BaseClient.)
Public methodOnlineEquals
Determines whether the specified OnlineObject is equal to the current OnlineObject.
(Inherited from OnlineObject.)
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 methodOnlineGetHashCode
Serves as a hash function for a particular type.
(Inherited from OnlineObject.)
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 methodOnlineGetType
Gets the OnlineType of the current instance.
(Inherited from OnlineObject.)
Public methodListDirectory
Retrieves list of files in remote directory.
Protected methodOnlineMemberwiseClone
Creates a shallow copy of the current OnlineObject.
(Inherited from OnlineObject.)
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 methodSetLastAccessTimeObsolete.
Sets the date and time the specified file was last accessed.
Public methodSetLastAccessTimeUtcObsolete.
Sets the date and time, in coordinated universal time (UTC), that the specified file was last accessed.
Public methodSetLastWriteTimeObsolete.
Sets the date and time that the specified file was last written to.
Public methodSetLastWriteTimeUtcObsolete.
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 methodOnlineToString
Returns a OnlineString that represents the current OnlineObject.
(Inherited from OnlineObject.)
Public methodUploadFile(Stream, String, Action UInt64 )
Uploads stream into remote file..
Public methodUploadFile(Stream, String, Boolean, Action 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 String )
Creates a new file, writes a collection of strings to the file, and then closes the file.
Public methodWriteAllLines(String,  String )
Creates a new file, write the specified string array to the file, and then closes the file.
Public methodWriteAllLines(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.
Public methodWriteAllLines(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.
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.
Back to Top
See Also