By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

Password Protected Program: How to do it?

P: n/a
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.
Nov 21 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Why not encrypt them and store them in the DataBase.
--
Dennis in Houston
"Stanav" wrote:
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.

Nov 21 '05 #2

P: n/a
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)?

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.com...
Why not encrypt them and store them in the DataBase.
--
Dennis in Houston
"Stanav" wrote:
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.

Nov 21 '05 #3

P: n/a
Stanav wrote:
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
Nov 21 '05 #4

P: n/a
Stanav,

Did you ever look to the inbuild system from windows (search key isinrole on
msdn). It is easy to use although it is incredeble difficult described in my
opinion.

http://msdn.microsoft.com/library/de...roletopic2.asp

I hope this helps,

Cor
Nov 21 '05 #5

P: n/a
Stanav wrote:
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.
Nov 21 '05 #6

P: n/a
Store an encrypted version in the database, the registry, or in a text file
(which can go in the user's application directory).

"Stanav" <st*******@hotmail.com> wrote in message
news:e8****************@TK2MSFTNGP14.phx.gbl...
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.

Nov 21 '05 #7

P: n/a
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.

"Marina" <so*****@nospam.com> wrote in message
news:ec**************@TK2MSFTNGP12.phx.gbl...
Store an encrypted version in the database, the registry, or in a text
file (which can go in the user's application directory).

"Stanav" <st*******@hotmail.com> wrote in message
news:e8****************@TK2MSFTNGP14.phx.gbl...
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.


Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.