1) In case the password/ key authentication request was not accepted by the server, the SftpException is thrown by the Sftp.Login method. The Status will be SftpExceptionStatus.OperationFailure in this case.
2) The SSH protocol itself prevents the packets from being "mistreated", so if Rebex Sftp client finishes the file upload without an error being thrown, the file should be uploaded just fine.
But if you really want to make sure the file integrity is ok, the good way to do so would be to compute the hash of the remote file.
The next release of Rebex SFTP will allow you to compute the remote file checksums (if the server supports it) - if you would like to receive a beta version supporting it, let us know! Update - here is the link to the trial beta version.
Please note that for instance OpenSSH does not support this SFTP extension. But even with SFTP servers that don't support it, it's possible to compute the remote checksum via the SshChannel.RequestExec
method. See this forum post for more details and sample code how to remotely compute a hash via a remote command on the SFTP server.