Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string GetMD5(string fileName)
- {
- try {
- var file = new FileStream(fileName, FileMode.Open);
- var md5 = new MD5CryptoServiceProvider();
- byte[] retVal = md5.ComputeHash(file);
- file.Close();
- file.Dispose();
- var sb = new StringBuilder();
- foreach (var t in retVal)
- sb.Append(t.ToString("x2"));
- return sb.ToString();
- }
- catch { return ""; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement