Password Protected Program: How to do it?

  • Thread starter Thread starter Stanav
  • Start date Start date
S

Stanav

Hello all,
I'm writing a program that interacts with databases. I want that when the
users run this program, they can view the data as much as they want. But if
they make any changes to the data and then attempt to update it, the program
will ask for a password. My question is, how can I go about doing this? I
can create a string variable and set it to something for the password, and
then check the user's input against this password value, but this will cause
the password to be fixed ---> Not good. So, I need some mechanism that
allows the password to be changed at runtime if the user wishes to.
Please give me some ideas like where I should store the passwords in the
program (not at an external file, because people may snoop around and find a
way to get into this file).
Thank you very much.
Stanav.
 
Then I have to create another table in the database just for the password?
Why can't I use something such as a hidden control (label or textbox) and
set the control.Text = "password" programmatically? For example:

'In design view
-Add a Label control to the form (Label1)
-Set the Text property of Label1 to "Password"

I can programmatically change Label1.Text = "whatever" in code, but once the
form restart (a new instance) then Label1.Text is still "Password"... Is
there anyway to make Label1.Text = "whatever" permanently (not just during
runtime)?
 
Stanav said:
Hello all,
I'm writing a program that interacts with databases. I want that when the
users run this program, they can view the data as much as they want. But if
they make any changes to the data and then attempt to update it, the program
will ask for a password. My question is, how can I go about doing this? I
can create a string variable and set it to something for the password, and
then check the user's input against this password value, but this will cause
the password to be fixed ---> Not good. So, I need some mechanism that
allows the password to be changed at runtime if the user wishes to.
Please give me some ideas like where I should store the passwords in the
program (not at an external file, because people may snoop around and find a
way to get into this file).
Thank you very much.
Stanav.

Store it in the database?

Chris
 
Stanav said:
Hello all,
I'm writing a program that interacts with databases. I want that when the
users run this program, they can view the data as much as they want. But if
they make any changes to the data and then attempt to update it, the program
will ask for a password. My question is, how can I go about doing this? I
can create a string variable and set it to something for the password, and
then check the user's input against this password value, but this will cause
the password to be fixed ---> Not good. So, I need some mechanism that
allows the password to be changed at runtime if the user wishes to.
Please give me some ideas like where I should store the passwords in the
program (not at an external file, because people may snoop around and find a
way to get into this file).
Thank you very much.
Stanav.

If you're determined to store your password in your code, don't store
the actual password but a hash/checksum or something like that. That wat
they can't look it up as easily.
 
Store an encrypted version in the database, the registry, or in a text file
(which can go in the user's application directory).
 
Thank you all for the inputs. I'll probably go with the encrypted text file
route if I can't find a way to store it directly in the app.
Stanav.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top