Android Question Counting password try

tcgoh

Active Member
Licensed User
Longtime User
Hi,

I am trying to limit the user on 3 attempt on A password, If unsuccessful after 3 times password file will be deleted. Any ideal how to code this?

Thanks
 

microbox

Active Member
Licensed User
Longtime User
Hi, not tested but I hope you can get something from it...
B4X:
Sub searchPass(str1 As String)   
Dim del As Map
del.Initialize
del = DBUtils.ExecuteMap(SQL, "SELECT password FROM account WHERE password = '" & str1 & "'",Null)
If del.IsInitialized Then
      If Not (del.Get("password") == Null) Then
         'Log("Pass Okay: "& del.Get("password"))   
         wrongPass = 0 
      End If
Else
Log("Not found")
wrongPass = wrongPass+1
'NOTE: variable wrongPass should be declared at Sub Globals
'Dim wrongPass as int
if(wrongPass>3) then
'-DELETE something-
wrongPass = 0
End if
End If
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…