来源:http://niunan.iteye.com/blog/261313
//① 导入命名空间:
using System.Web.Security;
//② 获取MD5码:
string Password = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox1.Text.ToString(), "MD5");