快速使用 Romanysoft LAB 的技术实现 HTML 开发Mac OS App,并销售到苹果应用商店中。
《 HTML开发Mac OS App 视频教程》
官方QQ群:( 申请加入,说是我推荐的 )
1 using System.Security.Cryptography; 2 using System.IO;
1 static public string GetMD5WithString(string sDataIn) 2 { 3 string str = ""; 4 byte[] data = Encoding.GetEncoding("utf-8").GetBytes(str); 5 MD5 md5 = new MD5CryptoServiceProvider(); 6 byte[] bytes = md5.ComputeHash(data); 7 for (int i = 0; i < bytes.Length; i++) 8 { 9 str += bytes[i].ToString("x2"); 10 } 11 return str; 12 }
1 static public string GetMD5WithFilePath(string filePath) 2 { 3 FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read); 4 MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); 5 byte[] hash_byte = md5.ComputeHash(file); 6 string str = System.BitConverter.ToString(hash_byte); 7 str = str.Replace("-", ""); 8 return str; 9 }