Hi Dw.

I'm using this code available from here and I have changed it from keeping the hashs on a variable(array) to writing it on a file. Now what I want to do is to read this file.

Basically I'm scanning through all my drive file and for each file I hash it and its hash code I save it on a text file on its own line and I have a special separator then a file name. So what I want to do is to read through the text file and get the names and on each file I chech if it does exist on the text file and then read the hash to a variable then hash the file again now I hash to only see if the file has ben modified or not. but the problem is that I don't know how will I convert the hash read from text file line because it is read as a string so it can't compare a byte to a text.

any Idea how I could solve this.

Recommended Answers

All 2 Replies

You don't indicate what hash algorithm(s) you are using. Most generate hash values as hexadecimal strings which you should be able to compare. I'm sure VB.net supports md5 as well as sha256 algorithms. md5 is much faster and is generally good for this purpose. sha256 is more commonly used for crypto systems and for signing program packages and source code to detect hacking.

My program is exactly the same as that on the link, but instead of keeping the hash's in a variable I log it(write it on a file on each line)

The line is in this format:

Hash_here Separator File_Name

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.