View Full Version : need help with getting value from table (Advanced users)
aviranak
12-31-2005, 05:59 AM
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.
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 :
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 :
table_reguname = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\mainapp\\Users")
and compare them to the loginl (user name) input field ?
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.
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 :
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 :
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
TJ_Tigger
01-02-2006, 02:26 PM
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
Daniel TM
01-02-2006, 04:05 PM
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.
Daniel TM
01-02-2006, 04:21 PM
This is an updated version of that logon project.
aviranak
01-03-2006, 02:53 AM
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);
???
TJ_Tigger
01-03-2006, 10:46 AM
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.
aviranak
01-03-2006, 12:27 PM
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);
???
Daniel TM
01-03-2006, 06:09 PM
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!
aviranak
01-04-2006, 04:33 PM
thanks for all your help guyz...but this little thing did the trick (with some modifing ofcorse :) :
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 :) :yes
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 :)
Corey
01-04-2006, 04:41 PM
thanks to Adam Kapilik from the support team with this litle loop
3 cheers for Adam. Woop, woop woop! :yes :yes :yes :yes :yes :yes :yes :yes :yes :yes
Intrigued
01-04-2006, 05:06 PM
3 cheers for Adam. Woop, woop woop! :yes :yes
He's much better even in college video! (@Adam - ;))
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.