使用md5加密算法對post提交的數據進行加密,具體方法如下:
public static bool IsTrue(string miyao, params string[] parm)
{
StringBuilder sb = new StringBuilder();
foreach (string s in parm)
{
sb.Append(s);
}
sb.Append(GameKey);//公鑰
string m= EncryptMD5(sb.ToString());//拼接后MD5加密的密鑰
if (m.ToLower() == miyao.ToLower())
{
return true;
}
else
{
return false;
}
}
public static string EncryptMD5(string txt)
{
return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txt, "MD5");
}