Question How can I tell when an XML file has changed?

You can use the following code snippet to SHA256 a file - two files having the same size and SHA256 are virtually guaranteed to have the same content

VB.NET:
Public Function GetChecksum(file__1 As String) As String 
    Using stream As FileStream = File.OpenRead(file__1) 
        Dim sha As New SHA256Managed() 
        Dim checksum As Byte() = sha.ComputeHash(stream) 
        Return BitConverter.ToString(checksum).Replace("-", [String].Empty) 
    End Using 
End Function
 

Latest posts

Back
Top