Closed broglodyte closed 5 years ago
SftpClient and FileStream both implement IDisposable, so you don't need to call fs.Close() or client.Disconnect(). They're both handled by their respective Dispose() methods, which get called automatically at the end of their using blocks.
SftpClient
FileStream
IDisposable
fs.Close()
client.Disconnect()
Dispose()
using
Thanks
SftpClient
andFileStream
both implementIDisposable
, so you don't need to callfs.Close()
orclient.Disconnect()
. They're both handled by their respectiveDispose()
methods, which get called automatically at the end of theirusing
blocks.