using System.Web.Security;
public static string Encrypt(string Password,int Format)
{
string str = "";
switch(Format)
{
case 0:
str = FormsAuthentication.HashPasswordForStoringInConfigFile(Password,"SHA1");
break;
case 1:
str = FormsAuthentication.HashPasswordForStoringInConfigFile(Password,"MD5"); //MD5加密
break;
}
return str;
}