quickly use romanysoft LAB
Technology to implement HTML development Mac OS apps and sell them to the Apple App Store.
"HTML development mac OS App video tutorial"
- Tudou Sync Update: http://www.tudou.com/plcover/VHNh6ZopQ4E/
- Baidu Network disk synchronization: Http://pan.baidu.com/s/1jG1Q58M
- Share [Chinese documentary] The Internet age Http://pan.baidu.com/s/1qWkJfcS
Official QQ Group: ( apply to join, say I recommend it
)
- App Practice 434558944
- App Learning Exchange 452180823
STEP1: Introducing Libraries
1 using System.Security.Cryptography; 2 using System.IO;
STEP2: Computes the Md5 value of a string
1 Static Public stringGetmd5withstring (stringSdatain)2 {3 stringstr ="";4 byte[] data = encoding.getencoding ("Utf-8"). GetBytes (str);5MD5 MD5 =NewMD5CryptoServiceProvider ();6 byte[] bytes =Md5.computehash (data);7 for(inti =0; I < bytes. Length; i++)8 {9str + = Bytes[i]. ToString ("X2");Ten } One returnstr; A}
STEP3: Calculating the MD5 value of a file
1 Static Public stringGetmd5withfilepath (stringFilePath)2 {3FileStream file =NewFileStream (FilePath, FileMode.Open, FileAccess.Read, fileshare.read);4MD5CryptoServiceProvider MD5 =NewMD5CryptoServiceProvider ();5 byte[] Hash_byte =Md5.computehash (file);6 stringstr =System.BitConverter.ToString (hash_byte);7str = str. Replace ("-","");8 returnstr;9}
C # Methods for calculating the MD5 values of strings and files