Hello, Ole!
O> How do I compare two byte arrays in a if statement?
You have to loop through array comparing every item.
Smth like
bool IsEqual(byte[] arr1, byte[] arr2)
{
if ( arr1 == null || arr2 == null )
return false;
if ( arr1.Length != arr2.Length )
return false;
//and here is the check loop
for(int i = 0; i < arr1.Length; i++ )
{
if ( arr1[i] != arr2[i] )
return false;
}
return true;
}
--
Regards, Vadym Stetsyak
www:
http://vadmyst.blogspot.com