Announcement

Collapse
No announcement yet.

Reoccurring password

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reoccurring password

    Hello, hello.
    Take a look at the verbiage I have below. What I’m asking this page to do On Initialize is first check to see if the user input a password by looking in the registry. If they did, go to the bottom of the page (<font color=green>continue</font color=green>).
    Now if the password was not input, it would ask for a password and then write it to the registry, so the next time the CD is used, it will see that the password was stored in the registry and bypass having to input that information again.

    My problem is that the first part of this verbiage does not catch the fact that I do have the password installed.

    Hello, hello.
    Take a look at the verbiage I have below. What I’m asking this page to do On Initialize is first check to see if the user input a password by looking in the registry. If they did, go to the bottom of the page (<font color=green>continue</font color=green>).
    Now if the password was not input, it would ask for a password and then write it to the registry, so the next time the CD is used, it will see that the password was stored in the registry and bypass having to input that information again.

    My problem is that the first part of this verbiage does not catch the fact that I do have the password installed.

    Help!

    <font color=green>// Does the user have a valid password, If yes, continue to the bottom of this page.</font color=green>
    Registry.SetValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Action Examples\data", "pwdbin", "%EnteredText%")
    %DoesKeyExist% = Registry.DoesKeyExist ("HKEY_LOCAL_MACHINE\SOFTWARE\Action Examples\data")
    <font color=blue>IF (%DoesKeyExist% = FALSE)</font color=blue>
    Registry.SetValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Action Examples\data", "pwdbin", "%EnteredText%")
    GOTO ("false")
    <font color=blue>ELSE</font color=blue>
    GOTO ("continue")
    <font color=blue>END IF</font color=blue>





    <font color=blue>false</font color=blue>
    <font color=green>// This action script will ask the user for a password, and give them 3 tries to get it right

    // We'll give the user 3 tries</font color=green>
    %attempts_remaining% = "3"

    <font color=green>// While the user has any attempts remaining...</font color=green>
    <font color=blue>WHILE (%attempts_remaining% > 0)</font color=blue>

    <font color=green>// Prompt the user for their password</font color=green>
    %EnteredText% = Dialog.GetInformation ("Attention", "Please enter your password:")

    <font color=green>// Try to find that password in a global list</font color=green>
    %ItemIndex% = GlobalList[Passwords].Find (%EnteredText%)

    <font color=blue>IF (%ItemIndex% = -1)</font color=blue>

    <font color=green>// The password is not valid (no matching password found)
    // Does the user have any tries left?</font color=green>
    <font color=blue>IF (%attempts_remaining% > 1)</font color=blue>
    <font color=green>// The user still has attempts remaining
    // Prompt the user to try again</font color=green>
    %Result% = Dialog.MessageBox ("Incorrect Password", "Incorrect password. Please try...", Ok, Exclamation)
    <font color=blue>ELSE</font color=blue>
    <font color=green>// This was the user's last attempt
    // All attempts were not valid, so exit the application</font color=green>
    %Result% = Dialog.MessageBox ("Incorrect Password", "Password verification failed. ...", Ok, Exclamation)
    Application.Exit
    <font color=blue>END IF</font color=blue>

    <font color=blue>ELSE</font color=blue>
    <font color=green>// The password is valid</font color=green>
    GOTO ("Password is valid")
    <font color=blue>END IF</font color=blue>

    <font color=green>// Decrease the number of attempts remaining by 1</font color=green>
    %attempts_remaining% = Evaluate (%attempts_remaining% - 1)
    <font color=blue>END WHILE</font color=blue>


    <font color=blue>Password is valid</font color=blue>
    %DoesKeyExist% = Registry.DoesKeyExist ("HKEY_LOCAL_MACHINE\SOFTWARE\Action Examples\data")
    <font color=blue>IF (%DoesKeyExist% = FALSE)</font color=blue>
    Registry.CreateKey ("HKEY_LOCAL_MACHINE\SOFTWARE\Action Examples\data")
    <font color=blue>END IF</font color=blue>
    Registry.SetValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Action Examples\data", "pwdbin", "%EnteredText%")
    %Result% = Dialog.MessageBox ("", "Password confirmed.", Ok, None)
    <font color=green>// The password-protected application continues on from here...</font color=green>


    <font color=blue>continue</font color=blue>


  • #2
    Re: Reoccurring password

    Sent you a message

    Sent you a message

    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

    Comment


    • #3
      Re: Reoccurring password

      Tigg thanks very much for your patience and valuable time. But after hours and hours and….hours of head banging and frustration I think I need to talk to the good people who built this.

      I think my problem with this program is I can't visualize what the #*&amp;@ that’s being said here. Sorry I deal better with visuals.

      %DoesKeyExist% = Registry.DoesKeyExist ("HKEY_CURRENT_USER\BruceTest")
      IF (%DoesKeyExist% = FALSE)
      %Result% = Dialog.MessageBox ("Title", "Does not exist", Ok, Question)
      RETURN
      END IF
      %ValueNames% = Registry.GetValueNames ("HKEY_CURRENT_USER\BruceTest")
      %RegData% = Registry.GetValueData ("HKEY_CURRENT_USER\BruceTest", "%ValueNames%")
      %Result% = Dialog.MessageBox ("Title", "SubKey Value Name %ValueName...", Ok, Question) Thank you Tigg!

      What does this mean? What is it saying? Don’t get me wrong here…I understand the basics (VERY BASICS) What do the symbols !=, !, +, ., *, /, MOD, (, ), % mean?????? What are their implications!?????? Why are they put in the places their put? Where in heqq can a CONCISE explanation of these frustrating little keystrokes be found in our beloved 4.0 on-line Help? Please will you give us a ballpark idea when your training CDs will be out? How about an extra $100 to let me beta test’em [cheesy grin].

      Comment


      • #4
        Re: Reoccurring password

        I will see what I can do here.

        <font color=green>%DoesKeyExist% = Registry.DoesKeyExist ("HKEY_CURRENT_USER\BruceTest") </font color=green>

        This line (above) will check to see if the registry key exists. It is looking for the key HKEY_CURRENT_USER\BruceTest. This was copied from a project I sent to you so you will need to change it to detect the Key you placed in the registry your self. This just looks for the key, not the data or value of any data in the key. If the key exists the variable will return TRUE if it does not exist it will return FALSE

        <font color=green>IF (%DoesKeyExist% = FALSE) </font color=green>

        This line will check to see if the variable from the previous line is equal to FALSE. This means that the key does not exist and in short your user has not saved a password from your application.

        <font color=green>%Result% = Dialog.MessageBox ("Title", "Does not exist", Ok, Question) </font color=green>

        This line will tell the user that the key/password does not exist, they can only hit OK.

        <font color=green>RETURN </font color=green>

        This will exit the actions list. No other actions will be performed.

        <font color=green>END IF</font color=green>

        This is the end of the above END statement

        The rest of the statements from here down will only be performed if the key existed in the registry.

        <font color=green>%ValueNames% = Registry.GetValueNames ("HKEY_CURRENT_USER\BruceTest") </font color=green>

        This line will get the value Names from the key called HKEY_CURRENT_USER\BruceTest. In the test case there should only be one value name that exists for this registry entry. In the example I sent, the value name should be pwdbin. It was my shorthand for password bin, as in a storage place for a password. [img]/ubbthreads/images/icons/smile.gif[/img]

        <font color=green>%RegData% = Registry.GetValueData ("HKEY_CURRENT_USER\BruceTest", "%ValueNames%") </font color=green>

        This line will get the Data from the above value name that is inside the key HKEY_CURRENT_USER\BruceTest. The data for the value will be the users password. In this case %ValueNames% will equal pwdbin. You could probably do with out the variables and just code in the value name without doing a query first, but that was the way I did it.

        <font color=green>%Result% = Dialog.MessageBox ("Title", "SubKey Value Name %ValueName...", Ok, Question) </font color=green>

        All that this does is open a dialog box that shows the name of the value and the password that was stored.

        I don't know if these explainations helped or not but there they are. [img]/ubbthreads/images/icons/smile.gif[/img]
        TJ-Tigger
        "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
        "Draco dormiens nunquam titillandus."
        Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

        Comment


        • #5
          Re: Reoccurring password

          Once again my hat goes off to you Tigg. But I would still like to know what those little key strokes mean...

          Thanks everyone

          Comment


          • #6
            Re: Reoccurring password

            Look in the help file here

            User's Guide - Chapter 10: Expressions - Operator Precedence and Associativity

            TJ-Tigger
            "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
            "Draco dormiens nunquam titillandus."
            Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

            Comment


            • #7
              Re: Reoccurring password

              Thanks Tigg!

              Comment

              Working...
              X