vb question!

houssam_ballout

New Member
hello all,
well I am doing a project on VB, and I want to create a login window that would give the admin (with special username and password) more privilege than the normal user (other username and password)?
Also,for that purpose, Do I need to create multiple forms, in which when entering admin user name I will access the admin form, or what????
anybody for help and suggestions.
thanks
 
houssam_ballout said:
hello all,
well I am doing a project on VB, and I want to create a login window that would give the admin (with special username and password) more privilege than the normal user (other username and password)?
Also,for that purpose, Do I need to create multiple forms, in which when entering admin user name I will access the admin form, or what????
anybody for help and suggestions.
thanks


You can create a variable that will change depending on whether the user logs in as normal or Admin. (Boolean variable, true if admin, false if normal) and then when the form loads run some validation before displaying certain parts of the form. Ex. if the admin variable is true display the admin menu at the top, if false, do not display that menu...

...that might work. Or, like you said a new completely different form could also work.
 
seperate form is the easiest bandaid solution....in industry, you would have a database with a table of users and their specific roles, a table of all the roles and what they allow

then you validate as things are shown such as: displayControls(role)
where it displays controls based on the role of the user

it could go waaaay more indepth than that, but it should give you an idea
 
okay

okay thanks, I will try to make different forms depending on the user
but is my system secure in that way???
is there any bugs that could be entered into ?
 
it really just depends on how and where you store your passwords for users

you can store them in a text file...this will allow you to change them at any time (if you just hard code the passwords then you can not change them unless you rebuild the exe's)

however a text file is easily accessable, so you would probably want some form of encryption algorythm to stop people from seeing them in plain text

if you are worried about people actually searching for passwords, then encrypt the pass and then translate it to hex, or look up some hashing algorythms which are one-way encryption and you have to encrypt the user's password when it is entered and compare the hashes
 
well, it is a project that I am doing for the uni, it is a registration system (stand-alone).
so, I must give the administration different (usually more) than the normal user. so I have to create a login page to identify the user that is going to use that system.
 
VB Is quite a hard programming language for encrypting your data. Although it is possible, for instance if you were to save the text file as a different and completely random name (HudScreen.Txt) then it wouldn't be a hackers first choice to look for.
I take it you can only use VB for this project, if not then I suggest you use C# or C++ these languages are much easier to encrypt data. Although if the whole idea is encryption in VB then you cannot.

Hope this helped.
 
Back
Top