Password

Is there anyway to make a password that is saved into the program?  I know how to make a external file and put a password in there, but I would rather like to put it in the programs.  Please help me!
mrcool4444Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wongchunCommented:
You can try to use "SaveSetting" to store the password in the run-time of the program.

And then use "GetSetting" to get back the password.

OR

If the password is fixed, you can hardcode in the coding.
0
mcriderCommented:
You can save information to the end of an EXE file without affecting the execution of the EXE.  For example, lets say you have an 80 character string... Open the EXE in append mode and then write the string...

This example gets the 80 character string back out of itself while the EXE is running:

        'THIS CONSTANT MUST BE CHANGE TO THE SIZE
        'OF THE ATTACHED BUFFER IN BYTES
        Const AttachedBufferSize = 80
         
        Dim MySelfFnum As Long
        Dim MySelfExe As String
        Dim MySelfSize As Long
        Dim lByte As Byte
        Dim AttachedBuffer As String
         
        'BUILD THE PATH TO MYSELF
        MySelfExe = App.Path
        If Not Right$(MySelfExe, 1) = "\" Then MySelfExe = MySelfExe + "\"
        MySelfExe = MySelfExe + App.EXEName + ".EXE"
         
        'GET A FREE FILENUMBER TO OPEN MYSELF AND OPEN MYSELF
        MySelfFnum = FreeFile
        Open MySelfExe For Binary Access Read As MySelfFnum
         
         
        'FIND THE START OF THE ATTACHED BUFFER
        MySelfSize = LOF(MySelfFnum)
        Seek MySelfFnum, MySelfSize - AttachedBufferSize + 1
         
        'EXTRACT THE ATTACHED BUFFER
        AttachedBuffer = ""
        Do
            Get #MySelfFnum, , lByte
            If EOF(MySelfFnum) = True Then Exit Do
            AttachedBuffer = AttachedBuffer + Chr$(lByte)
        Loop
         
        'CLOSE THE EXE
        Close MySelfFnum
       
        'SHOW THE ATTACHED BUFFER IN A MSGBOX
        MsgBox AttachedBuffer




Cheers!
0
mrcool4444Author Commented:
No, this isn't what I want.  What I want is something that asks the user for a password and when they type in the correct password, they go into my app.  On the same screen that you type the password there would be a change password button.  When you click it, it opens another form and asks for the old password and then the new one.  I would like it to write this stuff in the exe.   I know how to do this but just it writing to a file!
0
danelroismanCommented:
Hi mrcool4444!

Never save your password in file!
It's very dangerous and unsecure method
to do it.

Go to this link to see how to protect your application with password:

http://www.planet-source-code.com/vb/scripts/BrowseCategoryOrSearchResults.asp?lngWId=1

The encripted (!) password you can save in registry - I hope you know how to do this! If not - find a lot of examples on:

http://www.planet-source-code.com/vb/scripts/BrowseCategoryOrSearchResults.asp?lngWId=1

Enjoy!

Daniel


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.