V Vadym Stetsyak Jun 23, 2006 #2 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 != arr2 ) return false; } return true; } -- Regards, Vadym Stetsyak www: http://vadmyst.blogspot.com
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 != arr2 ) return false; } return true; } -- Regards, Vadym Stetsyak www: http://vadmyst.blogspot.com