Counter of login attempts?how to lock a system login after 3 failed attempts in vb6?Login page creating through Android EclipseHow to create a login page as always be logged in if once logged in?How to remove login page SugarCRMCrystal Reports 8 Issues From SQL 7 To SQL 2008 VB6PHP login page without databaseVariable iterating on itself - different behavior with different typeshow do i make login with session in laravel 5.4Login page is not working after uploading it to an online serverLogin page does not find the password
Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?
How to make a list of partial sums using forEach
How to preserve electronics (computers, iPads and phones) for hundreds of years
Pre-Employment Background Check With Consent For Future Checks
If Captain Marvel (MCU) were to have a child with a human male, would the child be human or Kree?
Should I assume I have passed probation?
Sigmoid with a slope but no asymptotes?
Typing CO_2 easily
Ways of geometrical multiplication
How to get directions in deep space?
How to write Quadratic equation with negative coefficient
How do you justify more code being written by following clean code practices?
Confusion over Hunter with Crossbow Expert and Giant Killer
Why the "ls" command is showing the permissions of files in a FAT32 partition?
How can ruler support inventing of useful things?
How to leave product feedback on macOS?
Is there a RAID 0 Equivalent for RAM?
Deciphering cause of death?
Why would five hundred and five be same as one?
Review your own paper in Mathematics
What is the meaning of "You've never met a graph you didn't like?"
How to understand "he realized a split second too late was also a mistake"
Is there a reason to prefer HFS+ over APFS for disk images in High Sierra and/or Mojave?
Proving an identity involving cross products and coplanar vectors
Counter of login attempts?
how to lock a system login after 3 failed attempts in vb6?Login page creating through Android EclipseHow to create a login page as always be logged in if once logged in?How to remove login page SugarCRMCrystal Reports 8 Issues From SQL 7 To SQL 2008 VB6PHP login page without databaseVariable iterating on itself - different behavior with different typeshow do i make login with session in laravel 5.4Login page is not working after uploading it to an online serverLogin page does not find the password
I am designing a login page in visual basics 6.0. I have to include a counter such that after three unsuccessful attempts the page will close itself. I have written following code in command button. Although there is no errors but the counter is not working. Here is the code:
Private Sub Command1_Click()
Dim count As Integer
count = 0
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
vb6 login-page
add a comment |
I am designing a login page in visual basics 6.0. I have to include a counter such that after three unsuccessful attempts the page will close itself. I have written following code in command button. Although there is no errors but the counter is not working. Here is the code:
Private Sub Command1_Click()
Dim count As Integer
count = 0
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
vb6 login-page
1
Just changeDimtoStaticso it keeps its value across calls; and get rid of the line that sets it to zero.
– Idle_Mind
Mar 7 at 22:01
1
@Idle_Mind You're right, I'd shifted my parameters over :-)
– ItsPete
Mar 7 at 22:08
add a comment |
I am designing a login page in visual basics 6.0. I have to include a counter such that after three unsuccessful attempts the page will close itself. I have written following code in command button. Although there is no errors but the counter is not working. Here is the code:
Private Sub Command1_Click()
Dim count As Integer
count = 0
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
vb6 login-page
I am designing a login page in visual basics 6.0. I have to include a counter such that after three unsuccessful attempts the page will close itself. I have written following code in command button. Although there is no errors but the counter is not working. Here is the code:
Private Sub Command1_Click()
Dim count As Integer
count = 0
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
vb6 login-page
vb6 login-page
edited Mar 8 at 12:15
DaveInCaz
3,32532041
3,32532041
asked Mar 7 at 21:51
J. AndersonJ. Anderson
122
122
1
Just changeDimtoStaticso it keeps its value across calls; and get rid of the line that sets it to zero.
– Idle_Mind
Mar 7 at 22:01
1
@Idle_Mind You're right, I'd shifted my parameters over :-)
– ItsPete
Mar 7 at 22:08
add a comment |
1
Just changeDimtoStaticso it keeps its value across calls; and get rid of the line that sets it to zero.
– Idle_Mind
Mar 7 at 22:01
1
@Idle_Mind You're right, I'd shifted my parameters over :-)
– ItsPete
Mar 7 at 22:08
1
1
Just change
Dim to Static so it keeps its value across calls; and get rid of the line that sets it to zero.– Idle_Mind
Mar 7 at 22:01
Just change
Dim to Static so it keeps its value across calls; and get rid of the line that sets it to zero.– Idle_Mind
Mar 7 at 22:01
1
1
@Idle_Mind You're right, I'd shifted my parameters over :-)
– ItsPete
Mar 7 at 22:08
@Idle_Mind You're right, I'd shifted my parameters over :-)
– ItsPete
Mar 7 at 22:08
add a comment |
2 Answers
2
active
oldest
votes
Just change Dim to Static so it keeps its value across calls. And also get rid of the line that sets it to zero:
Private Sub Command1_Click()
Static count As Integer
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
Thank You, It worked.
– J. Anderson
Mar 7 at 22:34
add a comment |
You set your count to 0 each time that Command1 is clicked. You need to declare count outside of that sub & initialise it to 0 elsewhere.
Private count As Integer
Private Sub Command1_Click()
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55053363%2fcounter-of-login-attempts%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Just change Dim to Static so it keeps its value across calls. And also get rid of the line that sets it to zero:
Private Sub Command1_Click()
Static count As Integer
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
Thank You, It worked.
– J. Anderson
Mar 7 at 22:34
add a comment |
Just change Dim to Static so it keeps its value across calls. And also get rid of the line that sets it to zero:
Private Sub Command1_Click()
Static count As Integer
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
Thank You, It worked.
– J. Anderson
Mar 7 at 22:34
add a comment |
Just change Dim to Static so it keeps its value across calls. And also get rid of the line that sets it to zero:
Private Sub Command1_Click()
Static count As Integer
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
Just change Dim to Static so it keeps its value across calls. And also get rid of the line that sets it to zero:
Private Sub Command1_Click()
Static count As Integer
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
answered Mar 7 at 22:04
Idle_MindIdle_Mind
23.7k21424
23.7k21424
Thank You, It worked.
– J. Anderson
Mar 7 at 22:34
add a comment |
Thank You, It worked.
– J. Anderson
Mar 7 at 22:34
Thank You, It worked.
– J. Anderson
Mar 7 at 22:34
Thank You, It worked.
– J. Anderson
Mar 7 at 22:34
add a comment |
You set your count to 0 each time that Command1 is clicked. You need to declare count outside of that sub & initialise it to 0 elsewhere.
Private count As Integer
Private Sub Command1_Click()
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
add a comment |
You set your count to 0 each time that Command1 is clicked. You need to declare count outside of that sub & initialise it to 0 elsewhere.
Private count As Integer
Private Sub Command1_Click()
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
add a comment |
You set your count to 0 each time that Command1 is clicked. You need to declare count outside of that sub & initialise it to 0 elsewhere.
Private count As Integer
Private Sub Command1_Click()
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
You set your count to 0 each time that Command1 is clicked. You need to declare count outside of that sub & initialise it to 0 elsewhere.
Private count As Integer
Private Sub Command1_Click()
If Form1.Text1 = "admin" And Form1.Text2 = "admin" Then
MsgBox "Login Succesfull", vbOKOnly + vbInformation, "Welcome"
Else
count = count + 1
If count = 3 Then
End
Else
MsgBox "Login Unsuccesfull", vbOKOnly + vbCritical, "Try Again"
Form1.Text1 = ""
Form1.Text2 = ""
Form1.Text1.SetFocus
End If
End If
End Sub
edited Mar 7 at 22:06
answered Mar 7 at 21:59
ItsPeteItsPete
8801026
8801026
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55053363%2fcounter-of-login-attempts%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Just change
DimtoStaticso it keeps its value across calls; and get rid of the line that sets it to zero.– Idle_Mind
Mar 7 at 22:01
1
@Idle_Mind You're right, I'd shifted my parameters over :-)
– ItsPete
Mar 7 at 22:08