|
[这个贴子最后由天云上人在 2002/01/03 01:35pm 编辑]
因为2.x以来采用天云阁工作室自行设计的不可反算的密码加密算法(推荐使用),但由于部分站点需要与自已的社区结合,签于此,特提供一个ASP脚本供做转换参考。
(因为是密码加密后不可反算,所以每个加密的解密都需要玩家自已操作解决,下面的代码不包含HTML部分,请自行制作,程序以3.x以上版本的数据库库为例)
dim ID, Pwd
ID = Request.form("ID")
Pwd = Request.form(" wd")
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open "自己的数据库定义"
set rs =conn.execute("select * from Y where id=" & ID)
if not rs.eof and not rs.bof then
if rs("C1") = tick(Pwd) then
conn.execute "update Y set C1='" + Pwd + "' where ID=" & ID
response.write "密码修改成功。"
else
response.write "输入的密码不正确。"
end if
else
response.write "输入的ID号不存在。"
end if
set rs=nothing
conn.close
set conn=nothing
response.end
'密码加密
function Tick(mm)
set tt = Server.CreateObject("xsc.mm") '此控件(xsc.dll)需要联系销售服务中心索取
n = tt.tick(mm)
set tt = nothing
tick = n
End Function
|
|