Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 4th, 2007, 5:32 PM   #1
bigguy
Professional Programmer
 
bigguy's Avatar
 
Join Date: Sep 2005
Location: Arkansas
Posts: 291
Rep Power: 0 bigguy is an unknown quantity at this point
Send a message via AIM to bigguy Send a message via MSN to bigguy Send a message via Yahoo to bigguy
Reading Custom Values from a Custon Key in Registry

Hey yall. I got a question. I got something where you can make your own custom users, and their info is saved in the registry this is how I got it laid out.

HKLM
+SOFTWARE
+Download Blocker
+Admins
-Admin 1
-Admin 2
etc, etc.

I need it to where when they try to login all the Admin 1 and Admin 2 folders are added to a listbox. The user selects their Admin # and types in their usernam and password. Here is my problem. I dont know how to get it to look at the Admin's 1 folder so it can check with the username and password specified there. I dont want them to be able to select Admin 1 and their number be Admin 2, they put in their Username and Password and it still work.

Here is my code for creating the admins. If yall can help m with loggign them in it'd be great. thanks

#Region "Create Admin"
    Function CRAdmin()
        Dim name As String = txtname.Text
        Dim pass As String = txtpass.Text
        Dim i As Integer = txtnumber.Text
        Dim adminnumber As String = "Admin " & i
        Dim regkey As RegistryKey
        regkey = Registry.LocalMachine.CreateSubKey("Software\Download Blocker\Admins\" & adminnumber)
        regkey = Registry.LocalMachine.OpenSubKey("Software\Download Blocker\Admins\" & adminnumber, True)
        regkey.SetValue("Admin " & i & " Username", name)
        regkey.SetValue("Admin " & i & " Password", pass)
        txtnumber.Text = ""
        txtname.Text = ""
        txtpass.Text = ""
    End Function
__________________
Forgiveness is the fragrance that the violet sheds on the heal that has crushed it. - Mark Twain

We all make mistakes. If it doesn't kill us, it will make us stronger. If it does kill us, then it's to late, but it was a great ride while it lasted. - Seth Hall
bigguy is offline   Reply With Quote
Old Feb 5th, 2007, 7:16 PM   #2
alphonso
Programmer
 
Join Date: Dec 2005
Location: Philippines, where the seasons are: hot, and hotter
Posts: 72
Rep Power: 3 alphonso is on a distinguished road
why not try making a search algorithm wherein if you make your admins choose their number, the algo will search for the specified files you need?

By the way, just curious: Why did you decide to use a function when it doesn't return a value? Don't you think you should've used a Sub instead?
__________________
"The most incomprehensible idea about the universe is that it is comprehensible" - Albert Einstein
alphonso is offline   Reply With Quote
Old Feb 5th, 2007, 10:44 PM   #3
bigguy
Professional Programmer
 
bigguy's Avatar
 
Join Date: Sep 2005
Location: Arkansas
Posts: 291
Rep Power: 0 bigguy is an unknown quantity at this point
Send a message via AIM to bigguy Send a message via MSN to bigguy Send a message via Yahoo to bigguy
Thanks for the advice alphonso. Not sure why I made a function, thats code i coded while we was out of school on a snow day and I was staying up late. That code was written about 4 am , so I odnt know what I was doing really. I'll give your advice a try.
__________________
Forgiveness is the fragrance that the violet sheds on the heal that has crushed it. - Mark Twain

We all make mistakes. If it doesn't kill us, it will make us stronger. If it does kill us, then it's to late, but it was a great ride while it lasted. - Seth Hall
bigguy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:15 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC