eajunior Posted January 8, 2003 Report Share Posted January 8, 2003 sou programador em clipper a muito tempo, e estou fazendo um teste no fivewin, em meios programas em clipper possuo função de senha que permite o usuario tentar 3 vezes e quando ultrapassa esse limite o programa aborta. alguem tem uma função parecida, que pudesse estudar. o nome e senha ficam armazenados em dbf. Quote Link to comment Share on other sites More sharing options...
personal Posted January 8, 2003 Report Share Posted January 8, 2003 //--------- // Senha //--------- #include "L:\FW21\INCLUDE\FiveWin.ch" Function senha() Public _senha, botSNH, xVEZ DEFINE DIALOG pSENHA From 0,0 To 12,48 xVEZ := 1 @ 00.5, 06.5 Say "Digite sua senha para o Sistema " Size 140,11 @ 02.8, 10.0 Say "Senha" COLOR AZUL _senha := Space(06) @ 02.8, 13 Get _senha PASSWORD Pict "@!K" OF pSENHA Size 40,11 COLOR AZUL UPDATE @ 03.4, 08.5 BUTTON botSNH1 PROMPT "Confirmar" OF pSENHA Size 50,15 ACTION confSenha() @ 03.4, 21.0 BUTTON botSNH2 PROMPT "Cancelar" OF pSENHA Size 50,15 ACTION pSENHA:End() ACTIVATE DIALOG pSENHA CENTERED Return(nil) //--------------------------- Static Function confSenha() //--------------------------- // aqui voce faz a busca no seu arquivo IF ( UPPER(_senha) # "SENHA") msgStop("Senha inválida ", " Atenção") xVEZ += 1 If (xVEZ > 3) pSenha:End() EndIf pSENHA:Update() pSENHA:SetFocus() Return(.f.) Else msgStop("Senha OK ", " Atenção") EndIf pSenha:End() Return(.t.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.