• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

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!
0
mrcool4444
Asked:
mrcool4444
1 Solution
 
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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now