Home All Groups Group Topic Archive Search About

Problem Compare Two File

Author
25 Mar 2005 10:15 AM
Giuseppe
i must compare 2 files who are on two different pc
i try to calculare "HASH" but is different beetween PC1 AND PC2....

I TEST THIS CODE :

Dim _Sha1 As SHA1 = SHA1.Create
Dim Fs As FileStream
Fs = New FileStream(filename, FileMode.Open)
Return BytesToHex(_Sha1.ComputeHash(Fs))

OR

WITH MD5CryptoServiceProvider

But not it works....

why?

Author
25 Mar 2005 10:53 AM
Cor Ligthert
Giuseppe,

What is the meaning of this sentence

>i must compare 2 files who are on two different pc

I don't find a relation to it in your code.

Cor
Author
25 Mar 2005 11:17 AM
Giuseppe
I have a local file and a remote file;
I must verify throught remoting if the two files are identical,
So I need to calcolate an hash code.
The hash code calculated in the local machine is different from the hash
code calculated by remote machine, also if the two files are identical.
Author
25 Mar 2005 11:34 AM
Cor Ligthert
Giuseppe,

The only thing that can come in my mind is that by the writing of the files
different code tables are used.

Although for most Latin and German derived languages the Window code page is
the same.

http://www.microsoft.com/globaldev/reference/oslocversion.mspx

In your case is that the first thing that I would check.

Cor
Author
25 Mar 2005 11:53 AM
Giuseppe
The system operation are the same...(Windows XP, Italian Language)
I don't think is this

Thank You for the response...
Author
25 Mar 2005 12:00 PM
Cor Ligthert
Giuseppe,

> The system operation are the same...(Windows XP, Italian Language)
> I don't think is this
>
It is possible to change the code tables, I did it myself once for a test
and forget to set it back by accident.

Cor