Answer by Sharp Coders for C# MD5 hasher example
Import the name space using System.Security.Cryptography;Here is the function that returns you md5 hash code. You need to pass the string as parameter.public static string GetMd5Hash(string input){ MD5...
View ArticleAnswer by Brian ONeil for C# MD5 hasher example
I took your code put it in a console app and ran it with no errors, got the hash and the test file is deleted at the end of execution? I just used the .pdb from my test app as the file.What version of...
View ArticleAnswer by JP Alioto for C# MD5 hasher example
md5hasher.Clear() after your loop might do the trick.
View ArticleAnswer by Factor Mystic for C# MD5 hasher example
Why not open the file with FileShare.ReadWrite?
View ArticleAnswer by Jagd for C# MD5 hasher example
Have you tried setting md5Hasher to null before deleting the file? It probably has a handle still attached to the FileStream (memory leak perhaps).
View ArticleAnswer by Moose for C# MD5 hasher example
Did you try wrapping your MD5 object in a using() too? From the docs, MD5 is Disposable. That might make it let go of the file.
View ArticleC# MD5 hasher example
Edit: I've retitled this to an example as the code works as expected.I am trying to copy a file, get a MD5 hash, then delete the copy. I am doing this to avoid process locks on the original file, which...
View Article
More Pages to Explore .....