After making a sftp connection, using the function ListDirectory(path), checking IsConnected and if so calling Disconnect() will raise an exception.
Comments: ** Comment from web user: olegkap **
Comments: ** Comment from web user: olegkap **
Hi,
Can you provide a code example where this error will occur?
I just did following test but got no exception :(..
```
using (var sftp = new SftpClient(connectionInfo))
{
sftp.Connect();
var list = sftp.ListDirectory("");
foreach (var item in list)
{
Console.WriteLine(item.Name);
}
var a = sftp.IsConnected;
Console.Write(a);
sftp.Disconnect();
}
```
Thanks,
Oleg