C#之MD5加密!...
呵呵,为了便于以后使用,我封装了一个类,调用其中的方法即可得到加密后的字符串
//MD5加密类 class MD5Encryption { //16位MD5加密方法 public static string get16MD5(string strMD5) { string MD5 =""; MD5 =System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strMD5, "MD5").Substring(8, 16); return (MD5); } //32位MD5加密方法 public static string get32MD5(string strMD5) { string MD5=""; MD5 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strMD5, "MD5"); return (MD5); } }
探索代码的奥秘,享受技术的乐趣-_-!...