Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 12 of 12
  1. #1
    Join Date
    Apr 2005
    Posts
    37

    need help with getting value from table (Advanced users)

    ok...now i think that this is very hard (at least for me :0)
    i built an app that stores user name and passwords in the registery.
    now i manged to get the password value and compare it to an input that the user type.
    the problem is to get the user names and compare them to the input of the user.

    Code:
    table_reguname = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\mainapp\\Users")
    name = Table.Count(table_reguname)
    table_unamevar = Table.Concat(table_reguname, "::", 1, name)
    now how can i compare a table to the input field

    i tryed with repeat until loop :

    Code:
    table_reguname = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\mainapp\\Users")
    name = Table.Count(table_reguname)
    numLoopCount = 0;
    table_unamevar = Table.Concat(table_reguname, "::", 1, name)
    Debug.ShowWindow(true);
    repeat
    	namefil = Table.Remove(table_unamevar, 1)
    	Debug.Print("Removed Item ="..namefil);
    	numLoopCount = numLoopCount + 1;
    until (numLoopCount == 20) or (unamevar == loginl);
    loginl is the username input. mybe it looks stupid to those of you that is really good in this but for me it looks normal.

    so...is there a simple and working way to search in the values of :

    Code:
    table_reguname = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\mainapp\\Users")
    and compare them to the loginl (user name) input field ?
    Last edited by aviranak; 12-31-2005 at 05:04 AM.

  2. #2
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    Quote Originally Posted by aviranak
    ok...now i think that this is very hard (at least for me :0)
    i built an app that stores user name and passwords in the registery.
    now i manged to get the password value and compare it to an input that the user type.
    the problem is to get the user names and compare them to the input of the user.

    Code:
    table_reguname = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\mainapp\\Users")
    name = Table.Count(table_reguname)
    table_unamevar = Table.Concat(table_reguname, "::", 1, name)
    now how can i compare a table to the input field

    i tryed with repeat until loop :

    Code:
    table_reguname = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\mainapp\\Users")
    name = Table.Count(table_reguname)
    numLoopCount = 0;
    table_unamevar = Table.Concat(table_reguname, "::", 1, name)
    Debug.ShowWindow(true);
    repeat
    	namefil = Table.Remove(table_unamevar, 1)
    	Debug.Print("Removed Item ="..namefil);
    	numLoopCount = numLoopCount + 1;
    until (numLoopCount == 20) or (unamevar == loginl);
    loginl is the username input. mybe it looks stupid to those of you that is really good in this but for me it looks normal.

    so...is there a simple and working way to search in the values of :

    Code:
    table_reguname = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\mainapp\\Users")
    and compare them to the loginl (user name) input field ?
    I would use HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    How are you storing the username and password in the registry?

    One suggestion would be to store the user name as a key and the password as the data for that key(as a MD5 hash of course). Then you could use Registry.DoesKeyExist to see if the user exists and if it does then hash the password that was provided against the key that was stored for that user.

    Tigg
    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

  4. #4
    Join Date
    Oct 2005
    Location
    Brazil - Belo Horizonte
    Posts
    118
    aviranak. I created a logon project for you. It doesn't do anything but save an ini file to your desktop and show dialogs saying if you typed in the correct username, password and if you are loged on or not. This is just an example so you can get my source code and apply it to your project. I hope it helps.
    Attached Files
    Last edited by Daniel TM; 01-02-2006 at 03:20 PM.

  5. #5
    Join Date
    Oct 2005
    Location
    Brazil - Belo Horizonte
    Posts
    118
    This is an updated version of that logon project.
    Attached Files

  6. #6
    Join Date
    Apr 2005
    Posts
    37
    finnaly some help here...

    Daniel TM, your logon is nice but i need to work in the registery and not ini files.

    TJ_Tigger, i'm storing all the users under Software\\mainapp\\Users
    so Does key exist dosent help me here but you gave me an idea...

    is it possible to do somthing like this :

    Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\AviransCreations\\Users",\unamein)

    where the unamein is the user name so it can create evry user thet register a sub key for his own ?

    than i can use the
    uname = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\AviransCreations\\",\\unamein);

    ???

  7. #7
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Yes, sorry if I was not clear, but that is the idea I was trying to get across. Create a subkey for each user then you can use the DoesKeyExist to see the the username exists. And as the data you can store the password as the data for that user.
    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

  8. #8
    Join Date
    Apr 2005
    Posts
    37
    yes thats what i didt with the pass (md5 encryption ofcorse.)

    ok so how do i create a sub key with a varible ?

    is it possible to do somthing like this :

    Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\AviransCreations\\Users",\unamein)

    where the unamein is the user name so it can create evry user thet register a sub key for his own ?

    than i can use the
    uname = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\AviransCreations\\",\\unamein);

    ???

  9. #9
    Join Date
    Oct 2005
    Location
    Brazil - Belo Horizonte
    Posts
    118
    I modified that logon project. Now when you register it encrypts your username and password and saves the results in the following locations of the registry:

    Main Key: HKEY_LOCAL_MACHINE
    Sub Key: Software\AviransCreations\Users
    Value: Username
    Data: <Encrypted text that the user has inputed in the username input>

    Main Key: HKEY_LOCAL_MACHINE
    Sub Key: Software\AviransCreations\Users
    Value: Password
    Data: <Encrypted text that the user has inputed in the password input>

    Once you login it gets the values from those keys and decrypts them. Checks if the username and password are correct. If everything is correct a window popups saying that you are loged on. Otherwise a window popups up telling you what information you did not provide correctly.

    I hope you found what you wanted! Good luck!
    Attached Files
    Last edited by Daniel TM; 01-03-2006 at 05:12 PM.

  10. #10
    Join Date
    Apr 2005
    Posts
    37
    thanks for all your help guyz...but this little thing did the trick (with some modifing ofcorse :

    Code:
    result = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\");
    for k in result do
    Dialog.Message("",result[k]);
    end
    thanks to Adam Kapilik from the support team with this litle loop

    btw if you have an intrest of what i'm doing i'll be glad to upload exe demo for u untill i'll finish all the work and i'll be happy to upload an APZ for u to modify
    Last edited by aviranak; 01-04-2006 at 03:36 PM.

  11. #11
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    thanks to Adam Kapilik from the support team with this litle loop
    3 cheers for Adam. Woop, woop woop!

  12. #12
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Quote Originally Posted by Corey
    3 cheers for Adam. Woop, woop woop!
    He's much better even in college video! (@Adam - )
    Intrigued

Similar Threads

  1. string / table compare
    By gabrielfenwich in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 01-29-2005, 11:30 PM
  2. Printed User's Guide & Training CD's
    By Ted Sullivan in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 11-13-2003, 12:35 PM
  3. Printed User's Guide & Training CD's
    By Ted Sullivan in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 11-13-2003, 12:35 PM
  4. Creating a Table of Contents
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-03-2003, 11:35 AM
  5. INFO: Printing the User's Guide and Command Reference
    By Ted in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 01-23-2003, 02:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts