/// <Summary> /// MD5 Encryption /// </Summary> /// <Param name = "strsource"> Plaintext to be encrypted </Param> /// <Returns> Returns the 32-bit encryption result. </Returns> Public Static String Get_md5 ( String Strsource, String Sencode ){ // New System. Security. cryptography. MD5 MD5 = New System. Security. cryptography. md5cryptoserviceprovider (); // Obtain the ciphertext byte array Byte [] Bytresult = Md5.computehash (system. Text. encoding. getencoding (sencode). getbytes (strsource )); // Convert to a string and get 9 to 25 digits // String strresult = bitconverter. tostring (bytresult, 4, 8 ); // Converts a string to a 32-Bit String. String Strresult = Bitconverter. tostring (bytresult ); // The character string converted by bitconverter generates a separator between each character and needs to be removed. Strresult = strresult. Replace ( " - " ,"" ); Return Strresult. tolower ();}