打印本文 打印本文 关闭窗口 关闭窗口
VFP的数据库加密算法
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2049  更新时间:2009/4/24 21:43:28  文章录入:mintao  责任编辑:mintao
isForm.Text1.value
newpass=ThisForm.Text2.value
if isblank(newpass)
= messagebox("请重新输入新密码!",64,"信息提示")
ThisForm.Text1.setfocus()
return
endif
success=thisform.decode(oldpass)
if not success
= messagebox
("旧密码不正确,重新输入密码!",64,"信息提示")
ThisForm.Text1.setfocus()
return
endif
locate for klk.user_id =name &&new user logo
if found()=.f.
=messagebox("您是新用户!",64,"信息提示")
append blank
replace klk.user_id with name,klk.logo_ddate with date()
thisform.text3.setfocus
endif
thisform.Encode(newpass)
= messagebox
("旧密码已经修改完成,下次请使用新密码!",64,"信息提示")
ThisForm.Command2.setfocus
return

  注 意, 在 改 变 密 码 的 窗 口(form) 中, 要 定 义“ 加 密 过 程” 和“ 解 密 过 程”, 方 法 如 上 所 述。

  以 上 是 一 个 加 密 算 法 的 主 要 思 路 和 关 键 代 码, 其 它 部 分 读 者 可 自 行 设 计。 这 个 加 密 算 法 还 可 以 进 一 步 完 善。 如 采 用 不 同 的 函 数 进 行 运 算, 加 入 日 期, 使 每 个 人 每 天 的 密 码 都 不 一 样( 加 入 时 间 的 算 法 如 前 所 述, 利 用CDOW() 函 数 作 为 键 值 的 一 部 分。)。

上一页  [1] [2] 

打印本文 打印本文 关闭窗口 关闭窗口