tags:

views:

35

answers:

1

i have a listbox with images. I want know about number of times the same added to the listbox. Any solutions for that. plz tell me

Thanks in advance

A: 

If you want to check that the image itself, regardless of the file name, is not repeated then generate an MD5 checksum for the image data and store that.

If you want to make sure that the two are always linked then either tag it onto the end of the file or create a class which holds the image and the checksum together.

The MD5 check can be used to differentiate any data file, even different versions of the same file if the content is in anyway different.

ChrisBD
I dont know about MD5.can u plz give the source code if u with u
You need to use the MD5 class. It's in namespace System.Security.CryptographyPossible code (note that you can have the imageFile as a byte array or as a data stream):MD5 md5 = new MD5CryptoServiceProvider();byte[] md5Checksum = md5.ComputeHash(imageFileData);
ChrisBD