Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, 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.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Help ples 2nd time


  • Please log in to reply
10 replies to this topic

#1 heltune

heltune

  • Members
  • 59 posts
  • OFFLINE
  •  
  • Local time:01:02 AM

Posted 10 July 2005 - 02:12 AM

hi its me again.... it seems my first topic hasn't been answered yet but its okey nevertheless...
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
:thumbsup:

BC AdBot (Login to Remove)

 


#2 jgweed

jgweed

  • Members
  • 28,473 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Chicago, Il.
  • Local time:12:02 AM

Posted 10 July 2005 - 05:27 AM

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

Edited by jgweed, 10 July 2005 - 05:29 AM.

Whereof one cannot speak, thereof one should be silent.

#3 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:02 PM

Posted 10 July 2005 - 11:05 AM

In PsuedoCode:
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.

Edited by groovicus, 10 July 2005 - 11:14 AM.


#4 heltune

heltune
  • Topic Starter

  • Members
  • 59 posts
  • OFFLINE
  •  
  • Local time:01:02 AM

Posted 10 July 2005 - 12:37 PM

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...
:thumbsup:

thanks for the idea.

#5 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:02 PM

Posted 10 July 2005 - 01:39 PM

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.

#6 heltune

heltune
  • Topic Starter

  • Members
  • 59 posts
  • OFFLINE
  •  
  • Local time:01:02 AM

Posted 10 July 2005 - 05:30 PM

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...

#7 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:02 PM

Posted 10 July 2005 - 05:39 PM

I don't use VB, so I am not familiar with the syntax.

#8 heltune

heltune
  • Topic Starter

  • Members
  • 59 posts
  • OFFLINE
  •  
  • Local time:01:02 AM

Posted 10 July 2005 - 08:10 PM

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...

#9 heltune

heltune
  • Topic Starter

  • Members
  • 59 posts
  • OFFLINE
  •  
  • Local time:01:02 AM

Posted 10 July 2005 - 08:11 PM

tenks groovicius...
if you know Vb6.0 ples spare a time teaching me ...
ten you...

#10 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:02 PM

Posted 10 July 2005 - 08:21 PM

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.

#11 heltune

heltune
  • Topic Starter

  • Members
  • 59 posts
  • OFFLINE
  •  
  • Local time:01:02 AM

Posted 11 July 2005 - 11:44 AM

thanks groovicious...its ok.
:thumbsup:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users