<summary>//MD5 32-bit encryption (uppercase)///</summary>//<param name= "str" ></param> <returns></returns> static string UserMd5 (String str) {string cl = str; string pwd = ""; MD5 MD5 = MD5. Create ();//Instantiate a MD5 pair like//After encryption is an array of byte type, here to note the choice of encoding utf8/unicode, etc. byte[] s = MD5. ComputeHash (Encoding.UTF8.GetBytes (CL)); By using loops, an array of byte types is converted to a string that is a regular character formatted for (int i = 0; i < s.length; i++) {//Will be To the string using the hexadecimal type format. The formatted character is a lowercase letter, and if uppercase (X) is used, the character after the format is uppercase characters pwd = pwd + s[i]. ToString ("X"); } return pwd; }///<summary>//MD5 16-bit encryption after the password is lowercase//</summary>//<param name= "converts Tring "></param>///<returns></returns> public static string Getmd5str (String convertst Ring) {Md5cryptoserviceProvider MD5 = new MD5CryptoServiceProvider (); String t2 = bitconverter.tostring (Md5.computehash (UTF8Encoding.Default.GetBytes (convertstring)), 4, 8); t2 = T2. Replace ("-", "" "); t2 = T2. ToLower (); return T2; }//<summary>//MD5 16-bit encryption password is uppercase///</summary>//<param name= "converts Tring "></param>///<returns></returns> public static string Getmd5str (String convertst Ring) {MD5CryptoServiceProvider MD5 = new MD5CryptoServiceProvider (); String t2 = bitconverter.tostring (Md5.computehash (UTF8Encoding.Default.GetBytes (convertstring)), 4, 8); t2 = T2. Replace ("-", "" "); return T2; }///<summary>//MD5 encryption (lowercase)///</summary>//<param name= "input" ></pa ram>//<returns></returns> private static string Md5hash (String input) {MD5CryptoServiceProvider md5hasher = new MD5CryptoServiceProvider (); byte[] data = Md5hasher.computehash (Encoding.Default.GetBytes (input)); StringBuilder Sbuilder = new StringBuilder (); for (int i = 0; i < data. Length; i++) {sbuilder.append (Data[i]. ToString ("X2")); } return sbuilder.tostring (); }