private static string GetMD5HashFromFile(string fileName) { try { FileStream file = new FileStream(fileName, FileMode.Open); System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] retVal = md5.ComputeHash(file); file.Close(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < retVal.Length; i++) { sb.Append(retVal[i].ToString("x2")); } return sb.ToString(); } catch (Exception ex) { throw new Exception("GetMD5HashFromFile() fail,error:" + ex.Message); } }
C#獲取檔案MD5值方法
相關文章
- 獲取md5加密值加密
- c#獲取word檔案頁數、字數C#
- C#獲取URL引數值C#
- C# 解析獲取Url引數值C#
- PHP獲取檔案基本屬性的方法PHP
- 比較檔案是否相同,(比較MD5值)
- SpringBoot static 靜態方法獲取 yml 配置檔案Spring Boot
- Spring Boot EL獲取配置檔案中的值的方式Spring Boot
- C#讀取Xml檔案C#XML
- C語言 使用Cryptdll計算檔案md5值C語言
- C#獲取某個物件的屬性值C#物件
- C#反射設定屬性值和獲取屬性值C#反射
- C++ 獲取PE檔案自校驗值的程式碼C++
- C#讀取文字檔案和寫文字檔案C#
- C#讀取Json配置檔案C#JSON
- C# WinForm獲取程式所在路徑方法C#ORM
- 遞迴獲取檔案列表遞迴
- python request 獲取cookies value值的方法PythonCookie
- 獲取Linux系統中目錄檔案大小的方法Linux
- 獲取檔案字尾名的比較好的方法
- PHP 獲取檔案 副檔名 的常用方法小結【五種方式】PHP
- 通過反射獲取上傳檔案方法引數中的檔名反射
- C#讀取指定json配置檔案C#JSON
- php一句話獲取獲取檔案目錄的方法PHP
- C#獲取根目錄的方法總結C#
- python獲取程式執行檔案路徑的方法其一Python
- JavaScript獲取檔案字尾名JavaScript
- php獲取xml檔案內容PHPXML
- 如何通過WinDbg獲取方法引數值
- PING命令 獲取的TTL值 登錄檔位置
- 計算一個檔案的 md5 值很費時間嗎?
- C# 讀取txt檔案生成Word文件C#
- 使用awk和sed獲取檔案奇偶數行的方法總結
- Linux 中獲取檔案完整路徑的4種方法介紹Linux
- c#(解析xml檔案基礎方法)C#XML
- 修改檔案的md5碼
- 微信小程式獲取index索引值的方法微信小程式Index索引
- Spring boot 獲取yml檔案工具類Spring Boot
- Springboot 獲取jar包中的檔案Spring BootJAR