关于PHP和C#winform的
$new_password = base64_encode(pack("H*", sha1(utf8_encode($new_password))));
$updateSQL = sprintf("UPDATE accounts SET password = '{$new_password}' WHERE login = %s", GetSQLValueString($_SESSION['acm_account_name'],"text"));
mysql_select_db($database_l1jdb, $l1jdb);
$Result1 = mysql_query($updateSQL, $l1jdb) or die(mysql_error());
if ($Result1 == 1) {
echo "更改密码。";
echo "<a href=\"login.php?logout\"退出</a>";
exit;
} else {
echo "没有更改密码。";
echo "<a href=\"account.php\">返回</a>";
exit;
}
补充:高手看看,帮忙转成在C#winform中可以使用
追问:ASCIIEncoding.ASCII.GetString(Convert.FromBase64String("加密的密码"));这个加密可以达到下面这个加密的效果吗?
$new_password = base64_encode(pack("H*", sha1(utf8_encode($new_password))));