① 导入命名空间: using System.Web.Security; ② 获取 MD5码: string Password = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox1.Text.ToString(), " MD5"); 转载于:https://www.cnblogs.com/xiachufeng/archive/2009/12/16/1625735.html