使用md5加密与解密

  

首先引用命名空间:using System.Configuration;


在用户注册页面:

string pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(需要加密的文本框, "MD5").ToLower();


用户登录界面:

引用命名空间:using System.Security.Cryptography;

  string pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(需要加密的文本框, "MD5").ToLower();