| 12345678910111213141516171819 |
- using System.IO;
- using System.Security.Cryptography;
- namespace Base
- {
- public static class MD5Helper
- {
- public static string FileMD5(string filePath)
- {
- byte[] retVal;
- using (FileStream file = new FileStream(filePath, FileMode.Open))
- {
- MD5 md5 = new MD5CryptoServiceProvider();
- retVal = md5.ComputeHash(file);
- }
- return retVal.ToHex("x2");
- }
- }
- }
|