Xceed .NET Libraries Documentation
Xceed.SSH.Client Assembly / Xceed.SSH.Client Namespace / SFtpSession Class


In This Topic
    SFtpSession Class
    In This Topic
    Class that represents the session between a client and an SFTP server.
    Object Model
    SFtpSession ClassSFtpClient ClassSSHClient Class
    Syntax
    'Declaration
     
    
    Public Class SFtpSession 
       Implements System.IDisposable 
    'Usage
     
    
    Dim instance As SFtpSession
    public class SFtpSession : System.IDisposable  
    Remarks

    The SFtpSession class implements the System.IDisposable interface, meaning that every SFtpSession object that is created should also be disposed of by calling the Dispose method or, in C#, creating the SFtpConnection within a using block. If an instance of an SFtpSession object is not disposed of, connections with the SFTP server may remain active until the server times-out or the garbage-collector passes.

    Inheritance Hierarchy

    System.Object
       Xceed.SSH.Client.SFtpSession
          Xceed.SSH.Client.SFtpConnection

    Public Constructors
     NameDescription
    Public ConstructorOverloaded. Initializes a new instance of the SFtpSession class.  
    Top
    Public Fields
     NameDescription
    Public FieldThe default SFTP attributes.  
    Public FieldThe default valid file attributes.  
    Public Field  
    Public Field  
    Public Field  
    Top
    Protected Fields
     NameDescription
    Protected FieldThe SFtpClient that uses this SFtpSession.  
    Protected FieldThe SSHClient that uses this SFtpSession.  
    Protected FieldThe System.IO.TextWriter which will trace the communications between the client-side and the SFTP server.  
    Top
    Public Properties
     NameDescription
    Public PropertyTODODOC  
    Public PropertyGets the SFtpClient that uses this SFtpSession.  
    Public PropertyGets a value that indicates the SFtp protocol version number that the SFtp server uses for the current session.  
    Public PropertyGets the SSHClient that uses this SFtpSession.  
    Public PropertyGets or sets a value, in seconds, indicating after what period of time an SFTP operation should timeout.  
    Public PropertyGets or sets the System.IO.TextWriter which will trace the communications between the client-side and the SFTP server.  
    Top
    Public Methods
     NameDescription
    Public Methodstatic (Shared in Visual Basic)Overloaded.   
    Public MethodComputes a human-readable full pathname starting with "sftp://hostname" representing the fully qualified path of all host files containing the item and the path of the item itself.  
    Public MethodOverloaded. Computes the optimal buffer size for SFtp file transfers on the specified stream.  
    Public MethodOverloaded.   
    Public Method  
    Public MethodOverloaded. Releases all cached connections.  
    Public Methodstatic (Shared in Visual Basic)  
    Public Methodstatic (Shared in Visual Basic)Converts Xceed.SSH.SFtp.Attr values to System.IO.FileAttributes values.  
    Public Methodstatic (Shared in Visual Basic)Converts an SFTP path to an Xceed FileSystem path.  
    Public Methodstatic (Shared in Visual Basic)Converts System.IO.FileAttributes to Xceed.SSH.SFtp.SFtpConstants.  
    Public Methodstatic (Shared in Visual Basic)Converts an Xceed FileSystem path to an SFTP path.  
    Public Methodstatic (Shared in Visual Basic)Attempts to parse a string produced by the ComputeHostedFullName Method that breaks down the information into individual components.  
    Top
    Protected Methods
     NameDescription
    Protected MethodAllows the SFtpSession object to attempt to free resources and perform other cleanup operations before it is reclaimed by garbage collection.  
    Top
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Standard: netstandard2.0, netstandard2.1

    .NET Framework: net20, net35, net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also