BleepingComputer.com: Help ples 2nd time

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.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Help ples 2nd time if der is anyone out der...

#1 User is offline   heltune 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 57
  • Joined: 28-April 05

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:

#2 User is offline   jgweed 

  • Forum Addict
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Global Moderator
  • Posts: 27,222
  • Joined: 11-April 04
  • Gender:Male
  • Location:Chicago, Il.

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

This post has been edited by jgweed: 10 July 2005 - 05:29 AM

Whereof one cannot speak, thereof one should be silent.

#3 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

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.

This post has been edited by groovicus: 10 July 2005 - 11:14 AM

"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#4 User is offline   heltune 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 57
  • Joined: 28-April 05

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 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

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.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#6 User is offline   heltune 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 57
  • Joined: 28-April 05

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 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 10 July 2005 - 05:39 PM

I don't use VB, so I am not familiar with the syntax.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#8 User is offline   heltune 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 57
  • Joined: 28-April 05

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 User is offline   heltune 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 57
  • Joined: 28-April 05

Posted 10 July 2005 - 08:11 PM

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

#10 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

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.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#11 User is offline   heltune 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 57
  • Joined: 28-April 05

Posted 11 July 2005 - 11:44 AM

thanks groovicious...its ok.
:thumbsup:

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users