Welcome Guest ( Log In | Click here to Register a free account now! )
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.| Important Announcement: We have two terrific contests running on the site that I wanted all our members and guests to know about. The first contest is the HP Magic Giveaway, which is underway as of November 28th. More information can be found at this topic, which will be updated very soon with further information. The second contests, is for the chance to win two Seagate FreeAgent external hard drives. More information about this contest can be found here. These are both amazing contests and I suggest everyone submit an entry for them. - BleepingComputer Management |
![]() ![]() |
Jul 10 2005, 02:12 AM
Post
#1
|
|
|
Member ![]() ![]() Group: Members Posts: 57 Joined: 28-April 05 Member No.: 18,392 |
i have only one qwestion... HOW DO YOU MAKE A LOOP THAT WILL COUNT YOUR CHANCE... LET US SAY IN PASSWORD CHECKS... IM MAKING A PASSWORD BOX WER A PERSON CAN PUT DER PASSWORD BUT ONLY 3 TRIES MUST BE MADE... I WAS ABLE TO LOOP AND CODE ONE BUT IT SEEMS IT DIDNT MAKE OR THE WAY IT WORKS IS NOT WAT I WANT... IT KEEPS LOOPING UNTIL THE DESIRED NUMBER IS OBTAINED LET US SAY 3... WHEN YOU CLICK OK ON THE mSGBOX IT LOOPS AND THEN ENDS AT THE THIRD MSGBOX... IT DOES NOT GIVE YOU THE OPPORTUNITY TO PUT YOUR PASSWORD AGAIN ON THE TEXT PASSWORD BOX... IT LOOPS AND ENDS...PLES HELP HOW TO MAKE ONE... THANK YOU VERY MUCH.PLEASE |
|
|
|
Jul 10 2005, 05:27 AM
Post
#2
|
|
![]() Forum Addict ![]() ![]() ![]() ![]() ![]() ![]() Group: Global Moderator Posts: 20,642 Joined: 11-April 04 From: Chicago, Il. Member No.: 113 |
What is the program you are using to do this? is it VB? Can you copy the pertinent lines of code for others to look at?
Regards, John This post has been edited by jgweed: Jul 10 2005, 05:29 AM -------------------- Whereof one cannot speak, thereof one should be silent.
|
|
|
|
Jul 10 2005, 11:05 AM
Post
#3
|
|
![]() Hail Groovicus! ![]() ![]() ![]() ![]() ![]() ![]() Group: Site Admin Posts: 6,265 Joined: 5-June 04 From: Vermillion, SD Member No.: 689 |
In PsuedoCode:
CODE int Sentinel = 0 boolean validPassword = true while sentinel is less than 3, check the password if password is valid then break out of loop set sentinel = to 0 if password is invalid increase sentinel by one if sentinel = 3 validPasword = false if not validPassword is false end program And if you wouldn't mind, please don't type in all capital letters. This post has been edited by groovicus: Jul 10 2005, 11:14 AM -------------------- |
|
|
|
Jul 10 2005, 12:37 PM
Post
#4
|
|
|
Member ![]() ![]() Group: Members Posts: 57 Joined: 28-April 05 Member No.: 18,392 |
sorry for the caps lock thing... my apology...
is this code for Visual C++? if it is ill try to test it in VB6.0. i was referring to the VB6.0 code... sorry for the incomplete info. thank you aal of you for responding... thanks for the idea. |
|
|
|
Jul 10 2005, 01:39 PM
Post
#5
|
|
![]() Hail Groovicus! ![]() ![]() ![]() ![]() ![]() ![]() Group: Site Admin Posts: 6,265 Joined: 5-June 04 From: Vermillion, SD Member No.: 689 |
That is just psuedo code..it can be translated into any language. I am just showing you one way that it can be done. I could show you in Java, but that wouldn't do you any good. It is just a simple while loop, followed by a couple conditional loops once the while loop is finished.
How do you declare an int in VB? Do you know how to do a while loop in VB? Do you know how to do an if loop? Then do you know how to make a comaprison? There are probably a hundred different ways to code this. -------------------- |
|
|
|
Jul 10 2005, 05:30 PM
Post
#6
|
|
|
Member ![]() ![]() Group: Members Posts: 57 Joined: 28-April 05 Member No.: 18,392 |
thanks for the thought...
ill try to code it in VB6.0 it helped me understand i hope ill get it right... if you can suggest how to code it, it will further help me its your call... again thanks very much... |
|
|
|
Jul 10 2005, 05:39 PM
Post
#7
|
|
![]() Hail Groovicus! ![]() ![]() ![]() ![]() ![]() ![]() Group: Site Admin Posts: 6,265 Joined: 5-June 04 From: Vermillion, SD Member No.: 689 |
I don't use VB, so I am not familiar with the syntax.
-------------------- |
|
|
|
Jul 10 2005, 08:10 PM
Post
#8
|
|
|
Member ![]() ![]() Group: Members Posts: 57 Joined: 28-April 05 Member No.: 18,392 |
Private Sub cmdPass_Click()
If password.Text = "secret" Then Database.Hide Database2.Show Timer1.Enabled = False Else password.Text = "" password.SetFocus MsgBox "fdfgfg", 16, "ffdfdfd1" End If End Sub this is my code for my Vb6.0 it does work well but its limited, i want it to have a password lock that would give the user 3 tries to put their password and then after the third try it will close or stop them from entering... but of course after each tries there will be warning messages tthat would let the user know how many times he/she had put the password... i cant do it... it keeps onlooping until the desired number of n or tries is obtained... sori... ples help me... anyways thenks to you... besides learning Vb6.0 i am also doing a lesson on C++ it help me with that syntax thenks... |
|
|
|
Jul 10 2005, 08:11 PM
Post
#9
|
|
|
Member ![]() ![]() Group: Members Posts: 57 Joined: 28-April 05 Member No.: 18,392 |
tenks groovicius...
if you know Vb6.0 ples spare a time teaching me ... ten you... |
|
|
|
Jul 10 2005, 08:21 PM
Post
#10
|
|
![]() Hail Groovicus! ![]() ![]() ![]() ![]() ![]() ![]() Group: Site Admin Posts: 6,265 Joined: 5-June 04 From: Vermillion, SD Member No.: 689 |
I don't know VB.. this is just simple procedural programming.
If you want a user to know how many time they have tried to enter their password, then all you need to do is use your counter, which already holds the number you want to use anyway. -------------------- |
|
|
|
Jul 11 2005, 11:44 AM
Post
#11
|
|
|
Member ![]() ![]() Group: Members Posts: 57 Joined: 28-April 05 Member No.: 18,392 |
thanks groovicious...its ok.
|
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 4th December 2008 - 01:55 PM |