Session.CalculateFileChecksum Method

Calculates a checksum of a remote file.

Syntax

C#
public byte[] CalculateFileChecksum(string algorithm, string path)
VB.NET
Public Function CalculateFileChecksum(ByVal algorithm As String, ByVal path As String) As Byte()

Parameters

Name Description
string algorithm A name of a checksum algorithm to use.
Use IANA name of algorithm or use a name of any proprietary algorithm the server supports (with SFTP protocol only).
Commonly supported algorithms are sha-1 and md5.
string path A full path to a remote file to calculate a checksum for.

Return Value

An array containing the checksum.

Advertisements:

Exceptions

Exception Condition
InvalidOperationException Session is not opened.
SessionLocalException Error communicating with winscp.com.
See the exception documentation for details.
SessionRemoteException Session has failed.
Checksum algorithm specified is not supported.
Calculating checksum has failed.
See the exception documentation for details.
TimeoutException Timeout waiting for winscp.com to respond.

Remarks

Supported with SFTP and FTP protocols, subject to support of respective protocol extension.

Examples

Real-Life Examples

 
  library_session_calculatefilechecksum.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