闂佽 鍋撻柟顖滃椤ワ拷 (0) +1 闁荤姍宥嗗 (0) +1 闂傚⿴浜烽幏锟� (0) +1
闂佽 鍋撻柟顖滃椤ユ垿鏌熺€涙ê濮囧┑顕嗘嫹闂佸搫琚崕鍐诧耿閸涙潙缁╅柟顖滃椤ワ拷>>
0

正在阅读:用注册表对delphi程序加密用注册表对delphi程序加密

2004-10-09 12:19 出处:CSDN 作者:liuboalex 责任编辑:huangpeidan


  edit2.Visible:=true; frmPass.Caption:=′请设置新密码′;

  edit1.SetFocus; OK.Caption:=′设置′;

  end; TheReg.CloseKey; end;

  finally TheReg.Free; end; end;

  二、按钮的响应代码:包括新设密码和验证密码。


  procedure TfrmPass.OKClick(Sender: TObject);

  begin

  //根据Edit2的显示与否判断已有密码,进行验证

  if edit2.Visible=false then begin

  if pass(edit1.text)=ValueStr then begin

  showmessage(′密码正确!′); end

  else begin

  showmessage(′密码不正确!无权操作!′);

  halt; end; end //无密码,设置新密码

  else begin

  if edit1.text=edit2.text then begin

  TheReg := TRegistry.Create;

  TheReg.RootKey := HKEY—LOCAL—MACHINE;

  KeyName := ′SOFTWARE\Mypassword′;

  if TheReg.OpenKey(KeyName, True) then

  TheReg.WriteString(tempStr,pass(edit1.text));

  TheReg.CloseKey; end

  else begin

  showmessage(′再次键入的密码不一致,请重输!′);


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:

键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品
闂備礁缍婂ḿ褔顢栭崱妞绘敠闁逞屽墴閹鎷呴崨濠備淮濠碘槅鍋撻幏锟�闂備焦鎮堕崕鎶藉磻濞戙垹鏄ラ悘鐐板嫎娴滄粓鏌涢锝嗙闁告棑鎷�