Password Protected Program: How to do it?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stanav

    Password Protected Program: How to do it?

    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.


  • Dennis

    #2
    RE: Password Protected Program: How to do it?

    Why not encrypt them and store them in the DataBase.
    --
    Dennis in Houston


    "Stanav" wrote:
    [color=blue]
    > 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.
    >
    >
    >[/color]

    Comment

    • Stanav

      #3
      Re: Password Protected Program: How to do it?

      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" programmaticall y? For example:

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

      I can programmaticall y 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" <Dennis@discuss ions.microsoft. com> wrote in message
      news:2A2EFC8A-C325-4097-AA60-74CC612CD027@mi crosoft.com...[color=blue]
      > Why not encrypt them and store them in the DataBase.
      > --
      > Dennis in Houston
      >
      >
      > "Stanav" wrote:
      >[color=green]
      >> 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.
      >>
      >>
      >>[/color][/color]


      Comment

      • Chris

        #4
        Re: Password Protected Program: How to do it?

        Stanav wrote:[color=blue]
        > 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.
        >
        >[/color]

        Store it in the database?

        Chris

        Comment

        • Cor Ligthert [MVP]

          #5
          Re: Password Protected Program: How to do it?

          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.



          I hope this helps,

          Cor


          Comment

          • C-Services Holland b.v.

            #6
            Re: Password Protected Program: How to do it?

            Stanav wrote:[color=blue]
            > 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.
            >
            >[/color]

            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.

            Comment

            • Marina

              #7
              Re: Password Protected Program: How to do it?

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

              "Stanav" <stanav_12@hotm ail.com> wrote in message
              news:e8oe%234vv FHA.2312@TK2MSF TNGP14.phx.gbl. ..[color=blue]
              > 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.
              >[/color]


              Comment

              • Stanav

                #8
                Re: Password Protected Program: How to do it?

                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" <someone@nospam .com> wrote in message
                news:ec6dtT4vFH A.3864@TK2MSFTN GP12.phx.gbl...[color=blue]
                > Store an encrypted version in the database, the registry, or in a text
                > file (which can go in the user's application directory).
                >
                > "Stanav" <stanav_12@hotm ail.com> wrote in message
                > news:e8oe%234vv FHA.2312@TK2MSF TNGP14.phx.gbl. ..[color=green]
                >> 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.
                >>[/color]
                >
                >[/color]


                Comment

                Working...