wind8black
tiboo
pink87
wind8gray
linkt
wind
wind8purple
新年
jyezu87
植树节
经典蓝色
UID:8541
//判断是否是第一次使用function Wsz_IfFirst:Boolean;var sUser:string; sPass:string;begin result := false; RegF:=TRegistry.Create; RegF.RootKey :=HKEY_LOCAL_MACHINE; RegF.OpenKey("SOFTWARE\MicroSoft\whh726",TRUE); sUser := RegF.ReadString("user"); sPass := RegF.ReadString("pass"); if ((length(sUser)<=0) and (length(sPass)<=0)) thenresult := true ;RegF.Free; end;file://判断用户名和口令是否正确function Wsz_CheckUser(MyUser:string;MyPass :string):Boolean;var sUser:string; sPass:string;begin result:= false; RegF:=TRegistry.Create; RegF.RootKey :=HKEY_LOCAL_MACHINE; RegF.OpenKey("SOFTWARE\MicroSoft\whh726",TRUE); sUser := RegF.ReadString("user"); sPass := RegF.ReadString("pass"); if (sUser=MyUser) and (sPass=MyPass) thenresult := true;RegF.Free; end;file://保存用户名和口令procedure Wsz_SaveUser(MyUser:string;MyPass :string);begin RegF:=TRegistry.Create; RegF.RootKey :=HKEY_LOCAL_MACHINE; RegF.OpenKey("SOFTWARE\MicroSoft\whh726",TRUE); RegF.WriteString("user",MyUser); RegF.WriteString("pass",MyPass); RegF.Free;end;file://取消按纽事件procedure TWszLoginForm.BitBtnCloseClick(Sender: TObject);begin Close;end;file://确定按纽事件procedure TWszLoginForm.BitBtnYesClick(Sender: TObject);var suser:string; spass:string;begin suser := trim(edituser.text); spass := trim(editpass.text); if (length(suser)<=0) or (length(spass)<=0) then beginApplication.MessageBox("用户名和口令都必须输入!", "系统提示", MB_OK + MB_ICONINFORMATION); edituser.SetFocus ;exit; end; if Wsz_IfFirst then beginfile://处理第一次登录的用户名和口令if Application.MessageBox( "您是第一次使用本软件,请记住您的用户名和口令, 以便下次登录。现在进入系统吗?", "系统提示", MB_OKCANCEL + MB_ICONQUESTION) = IDOK then beginfile://保存Wsz_SaveUser(suser,spass); endelse begin edituser.SetFocus ; exit; end;end else beginif not Wsz_CheckUser(suser,spass) thenbeginApplication.MessageBox ("对不起,用户名和口令输入不正确!", "系统提示",MB_OK + MB_ICONINFORMATION); edituser.setfocus ;exit;end; end; file://全局变量 GB_Wsz_User := suser; GB_Wsz_PASS := spass; Close; end; file://窗体的Show事件procedure TWszLoginForm.FormShow(Sender: TObject); beginif Wsz_IfFirst then beginApplication.MessageBox("您是第一次使用本软件,您可以随便输入用户名和口令。", "系统提示",MB_OK + MB_ICONINFORMATION);end; end;
UID:20720
UID:8789
UID:20846
UID:20932
UID:21000