Net Encryption Library
CrcEqual Method
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class : CrcEqual Method
Path to the first file
Path to the second file
Returns true if the CRC is equal for two local files
Syntax
'Declaration
 
Public Function CrcEqual( _
   ByVal file1 As System.String, _
   ByVal file2 As System.String _
) As System.Boolean
'Usage
 
Dim instance As Encryption
Dim file1 As System.String
Dim file2 As System.String
Dim value As System.Boolean
 
value = instance.CrcEqual(file1, file2)
public System.bool CrcEqual( 
   System.string file1,
   System.string file2
)
public function CrcEqual( 
    file1: System.String;
    file2: System.String
): System.Boolean; 
public function CrcEqual( 
   file1 : System.String,
   file2 : System.String
) : System.boolean;
public: System.bool CrcEqual( 
   System.string* file1,
   System.string* file2
) 
public:
System.bool CrcEqual( 
   System.String^ file1,
   System.String^ file2
) 

Parameters

file1
Path to the first file
file2
Path to the second file
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 1024; i++)
    sb.AppendLine("This is a test");
 
File.WriteAllText("file1.txt", sb.ToString());
File.WriteAllText("file2.txt", sb.ToString());
 
bool filesSame = encryption.CrcEqual("file1.txt", "file2.txt");
Console.WriteLine("Files same: {0}", filesSame);
Dim encryption As New Encryption() 'Trial Mode
'Dim encryption As New Encryption("place user name here", "place license key here") 'License Mode
 
Dim sb As New StringBuilder()
For i As Integer = 0 To 1023
    sb.AppendLine("This is a test")
Next i
 
File.WriteAllText("file1.txt", sb.ToString())
File.WriteAllText("file2.txt", sb.ToString())
 
Dim filesSame As Boolean = encryption.CrcEqual("file1.txt", "file2.txt")
Console.WriteLine("Files same: {0}", filesSame)
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

Encryption Class
Encryption Members