Session.Dispose Method

If session was opened, closes it, terminates underlying WinSCP process, deletes XML log file and disposes object.

As opposed to Session.Close, it’s not possible to reuse the object afterwards.

Syntax

C#
public void Dispose()
VB.NET
Public Sub Dispose()

Remarks

This method implements IDisposable interface.

Advertisements:

When using Session class from C#/VB.NET, it is recommended to use using keyword, instead of calling Dispose directly (most examples here do that).

Though, when using Session class from other languages or through COM interface, you need to call Dispose directly.

Use Session.Close instead, if you want to reuse the object.

 
  library_session_dispose.txt · Last modified: by martin
 

Search Documentation

This page

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

Associations

Site design by Black Gate