首先需要引用using System.Security.Cryptography;
然后再调用FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5");方法即可!