>>216
これで60MBのファイルが600ミリ秒になったよ。


64KBずつ配列に読んで比較。

using (FileStream fs1=new FileStream(file1, FileMode.Open))
using (FileStream fs2 = new FileStream(file2, FileMode.Open))
{
if (fs1.Length != fs2.Length) return false;
int num = (int)fs1.Length;
byte[] data1 = new byte[num];
byte[] data2 = new byte[num];
int read;
while (true)
{
if (fs1.Position == fs1.Length) return true;
read = fs1.Read(data1, 0, 1024 * 64);
fs2.Read(data2, 0, 1024 * 64);
for (int i = 0; i < read; i++)
if (data1[i] != data2[i])
return false;
}
}