NET SFTP Library
CrcEqualLocal Method
Example 






KellermanSoftware.NetSFtpLibrary Namespace > SFTP Class : CrcEqualLocal Method
The local file path of the first file
The local file path of the second file
Return true if the Cyclic Redundancy Check is the same for two local files. This is a fast way to compare if two files are the same
Syntax
'Declaration
 
Public Function CrcEqualLocal( _
   ByVal file1 As System.String, _
   ByVal file2 As System.String _
) As System.Boolean
'Usage
 
Dim instance As SFTP
Dim file1 As System.String
Dim file2 As System.String
Dim value As System.Boolean
 
value = instance.CrcEqualLocal(file1, file2)
public System.bool CrcEqualLocal( 
   System.string file1,
   System.string file2
)
public function CrcEqualLocal( 
    file1: System.String;
    file2: System.String
): System.Boolean; 
public function CrcEqualLocal( 
   file1 : System.String,
   file2 : System.String
) : System.boolean;
public: System.bool CrcEqualLocal( 
   System.string* file1,
   System.string* file2
) 
public:
System.bool CrcEqualLocal( 
   System.String^ file1,
   System.String^ file2
) 

Parameters

file1
The local file path of the first file
file2
The local file path of the second file
Example
SFTP sftp = new SFTP(); //Trial Mode            
            //SFTP sftp = new SFTP("place user name here", "place license key here");
             
            // set the name of the SSH server( its URL )
            sftp.HostAddress = "some.sftp.server.com"; // replace with your SFTP server
            sftp.UserName  = "anonymous"; // replace with your user name
            sftp.Password = "user@mail.com"; // replace with your password
             
            bool result = sftp.CrcEqual("c:\\file1.txt", "c:\\file2.txt");
            Console.WriteLine("The files are the same : {0}",result);
Dim sftp As SFTP = New SFTP() 'Trial Mode
            'Dim sftp As SFTP = New SFTP("place user name here", "place license key here");
             
            ' set the name of the SSH server( its URL )
            sftp.HostAddress = "some.sftp.server.com" ' replace with your SFTP server
            sftp.UserName  = "anonymous" ' replace with your user name
            sftp.Password = "user@mail.com" ' replace with your password
             
            Dim result As Boolean = sftp.CrcEqual("c:\file1.txt", "c:\file2.txt")
            Console.WriteLine("The files are the same : {0}",result)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SFTP Class
SFTP Members