Password porgram for QB 4.5 
Author Message
 Password porgram for QB 4.5

I have made a program I would like to password portect, the only problem I
am having is that I can't get the words the user is typing in to look like
"*"'s can anyone help?


Sat, 05 Sep 1998 03:00:00 GMT  
 Password porgram for QB 4.5

Dan,

That topic has thoroughly been explored by this group. You can find
some excellant Ideas on the subject in the All-Basic-Code files. You
can retrieve the ABC code snippets at

http://members.gnn.com/dslayer/QBasic.htm  

or at the homepage links you'll find there...

Quote:
>I have made a program I would like to password portect, the only problem I
>am having is that I can't get the words the user is typing in to look like
>"*"'s can anyone help?

##############################################################
Raymond Joh                  If you can't tie a good knot...


Home Page ==>>http://members.aol.com/ggjoh/index.htm
##############################################################


Fri, 11 Sep 1998 03:00:00 GMT  
 Password porgram for QB 4.5

Quote:

>I have made a program I would like to password portect, the only problem I
>am having is that I can't get the words the user is typing in to look like
>"*"'s can anyone help?

' QBasic invisible password input, case sensitive. For case in-
' sensitive, use either LCASE$ or UCASE$ to convert keyboard input to
' PASS$ font.
'
' by Clif Penn   12/2/95

BS$ = CHR$(8)
tries = 0

DO
CLS

'  INPUT "Username: "; User$    is followed by program steps to link
'          the case insensitive name of the user with the case
sensitive
'          password. The rest of this program assumes the link is
made.
'   Back space is used for corrections.

   Pass$ = "PassWord"    ' fictional password
   Frag$ = ""
   LOCATE 5, 1
   PRINT SPACE$(70)
   LOCATE 5, 5:  PRINT "Password:";   'or wherever
   LOCATE , 16

   DO
      DO
         p$ = INKEY$
      LOOP UNTIL p$ <> ""
      IF (p$ = BS$) AND LEN(Frag$) > 0 THEN    'backspace correction
         Frag$ = LEFT$(Frag$, LEN(Frag$) - 1)
         LOCATE , 16
         PRINT SPACE$(40);
         LOCATE , 16
         PRINT STRING$(LEN(Frag$), "*");
      ELSE
         Frag$ = Frag$ + p$   ' concantanates the char to the password
         PRINT "*";
      END IF
   LOOP UNTIL LEN(Frag$) = LEN(Pass$)

   IF Frag$ <> Pass$ THEN
      proper = 0
      PRINT :  PRINT : PRINT "Access denied"
      PRINT "To try again, press a key. <Esc> to quit."
      DO
         k$ = INKEY$
         IF k$ = CHR$(27) THEN GOTO finis
      LOOP UNTIL k$ <> ""
    ELSE
      proper = 1
      PRINT : PRINT : PRINT "Password accepted, press a key"
      DO
      LOOP UNTIL INKEY$ <> ""
   END IF
   tries = tries + 1
   IF tries > 3 THEN
      CLS
      PRINT "INTRUDER! CALL SECURITY"
   END IF

LOOP UNTIL (proper = 1) OR (tries > 3)
finis:
END



Fri, 11 Sep 1998 03:00:00 GMT  
 Password porgram for QB 4.5
'Rundown of Parameters:
'FUNCTION GetInput$ (Row, Col, Prompt$, Default$, MaxLen, BlankBlock, PWord$,)
'
' Row - Integer; row on screen
' Col - Integer; column on screen
' Prompt$ - String; Prompt string (ex. "What is the password?")
' Default$ String; defaulted text (ex. "pass" [for the password])
' MaxLen - Integer; maximum length of string
' MinLen - Integer; minimum length of the string
' BlankBlock - String; character used for unused field spaces
' PWord - String; contains NULL if not password, else is used as special
'             blanking character
' KeyMask - String; contains a list of allowable chars, all else are ignored

DEFINT A-Z
DECLARE FUNCTION GetInput$ (Row%, Col%, Prompt$, Default$, MaxLen%, MinLen%, BlankBlock$, PWord$, Limit$)
CLS
Name$ = GetInput$(1, 1, "Name ======> ", "Joel Caturia", 15, 1, "*", "", "")
password$ = GetInput$(2, 1, "Password ==> ", "Joel Caturia", 15, 1, "*", "*", "")
DateTemp$ = GetInput$(3, 1, "Date ==> ", DATE$, 10, 10, "*", "", "1234567890-")
TimeTemp$ = GetInput$(4, 1, "Time ==> ", TIME$, 8, 8, "*", "", "1234567890:")
PRINT
PRINT "Name ========> "; Name$
PRINT "Password ====> "; password$
PRINT "Date ==> "; DateTemp$
PRINT "Time ==> "; TimeTemp$

FUNCTION GetInput$ (Row, Col, Prompt$, Default$, MaxLen, MinLen, BlankBlock$, PWord$, Limit$)
'**********************************************************
' FUNCTION GetInput$ () - the SMART input routine created
'                         by Corey S. Seliger
'                         HEAVILY MODIFIED BY JOEL CATURIA
'                         And Kevin Becker
'
' This FUNCTION is the replacement for QuickBASIC's INPUT
' routine. This routine allows you to have values already
' set so the user just has to go back and change a part of
' it, instead of having to reenter what goes into the
' field.
'
' **********************************************************
DO
  LOCATE Row, Col + LEN(Prompt$): PRINT STRING$(MaxLen, BlankBlock$);
  LOCATE Row, Col, 1, 10, 11
  PRINT Prompt$;
  Default$ = LTRIM$(RTRIM$(Default$))
  IF Default$ = STRING$(LEN(Default$), 0) THEN Default$ = ""
  IF LEN(Default$) <> 0 THEN
    LOCATE Row, Col + LEN(Prompt$): PRINT Default$;
    Queue$ = Default$
    LOCATE Row, Col + (LEN(Prompt$) + LEN(Default$))
  END IF
Start:  ' Added by KB
  DO
    Tmp$ = INKEY$
    IF Tmp$ <> "" THEN
        IF Tmp$ = CHR$(13) THEN
            Tmp$ = ""
            PRINT
            EXIT DO
        ELSEIF Tmp$ = CHR$(8) THEN
            Tmp$ = ""
            IF LEN(Queue$) >= 1 THEN
                LOCATE , POS(0) - 1: PRINT BlankBlock$; : LOCATE , POS(0) - 1
                Queue$ = LEFT$(Queue$, LEN(Queue$) - 1)
            ELSE
                SOUND 500, 1
                WHILE INKEY$ <> "": WEND
            END IF
        ELSEIF LEN(Tmp$) > 1 THEN
            SOUND 500, 1
            WHILE INKEY$ <> "": WEND
            Tmp$ = ""
        ELSEIF ASC(Tmp$) < 32 OR ASC(Tmp$) > 126 THEN
            SOUND 500, 1
            WHILE INKEY$ <> "": WEND
            Tmp$ = ""
        ' ***
        ' Put any other special cases before these lines!!!
        ' ***
        ELSEIF LEN(Queue$) < MaxLen THEN
                IF Limit$ <> "" THEN                                    ' Added by KB
                        IF NOT INSTR(Limit$, Tmp$) <> 0 THEN GOTO Start ' Added by KB
                END IF                                                  ' Added by KB
                Queue$ = Queue$ + Tmp$
                IF PWord$ = "" THEN
                        PRINT Tmp$;
                ELSE
                        PRINT PWord$;
                END IF
                ELSE
                        SOUND 500, 1
                        WHILE INKEY$ <> "": WEND
                        Tmp$ = ""
                END IF
    END IF
  LOOP
  IF LEN(Queue$) >= MinLen% THEN
    EXIT DO
  ELSE
    SOUND 500, 1
  END IF
LOOP
GetInput$ = Queue$
LOCATE , , 0
END FUNCTION

'-----------------------8<--------------
I got this from th FIDO QuickBasaic sub
PAX,
TCF
Too Cool Fool  03-25-96  John Rodgers
"Politics": from poli = many, tics = {*filter*}-sucking parasites
http://www.*-*-*.com/ ~coolfool/wiz/



Fri, 11 Sep 1998 03:00:00 GMT  
 Password porgram for QB 4.5


Quote:
>I have made a program I would like to password portect, the only problem I
>am having is that I can't get the words the user is typing in to look like
>"*"'s can anyone help?

Daniel,

The way to do this is to use the INKEY$ function.  This returns whatever
is currently being pressed on the keyboard.  Make a subroutine to catch
one key at a time and combine these into a string.  After every key
press, have the computer print a star.  If you need more info, e-mail
me and I will send you some sample code. Hope this helps.

-Colin Little

Notice to Postmaster:  I have decided not to post my last ten articles,
saving you hundreds if not thousands of dollars.  Prompt payment is
expected.



Sat, 12 Sep 1998 03:00:00 GMT  
 Password porgram for QB 4.5

Quote:


>Subject: Password porgram for QB 4.5
>Date: 19 Mar 1996 04:52:22 GMT
>I have made a program I would like to password portect, the only problem I
>am having is that I can't get the words the user is typing in to look like
>"*"'s can anyone help?

The basic idea is to read the keyboard with INKEY$ or INPUT$ and every time
you get a keystroke, print another '*".  You will of course have to check for
backspace, delete and cursor keys.


Sat, 12 Sep 1998 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Password program for QB 4.5

2. QB 4.0 Docs/QB 4.5 Wanted

3. want QB 4.5 QB 7.1 FOR FREE!!!

4. Where's QB.LIB in QB 4.5?

5. QB 4.5: reading 16 bit from a port

6. QB 4.5 - Expression too complex

7. Incorporating non-QBasic graphics into QB 4.5 programs

8. WTB: QB 4.5 Book!

9. QB 4.5 and CALL ABSOLUTE

10. Get command-line arguments in QB 4.5 ?

11. QB 4.5 versus VBDOS 1.0

12. Where to buy QB 4.5

 

 
Powered by phpBB® Forum Software