Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Can anyone spot anything wrong with this code? It wont compile for some reason.
Private Sub Form_Load()
Open "InfoL.txt" For Input As #1
Input #1, txtLogin.Text
Close #1
Open "InfoP.txt" For Input As #2
Input #2, txtPassword.Text
Close #2
End SubPrivate Sub Command1_Click()
If chkInfo = Checked Then
Open "InfoL.txt" For Output As #1
Print #1, txtLogin.Text
Close #1
Open "InfoP.txt" For Output As #2
Print #2, txtPassword.Text
Close #2
ElseIf chkInfo = Unchecked Then
Open "InfoL.txt" For Output As #1
Print #1, ""
Close #1
Open "InfoP.txt" For Output As #2
Print #2, ""
Close #2
End If
end sub

Open "InfoL.txt"
-- The compiler doesnt recognise this path, its right because its a file name not a path.. where is infol.txt? on c:\ if so put c:\infoL.txt
is it in a subdirectory of c:\ (like text's)
if soits c:\texts\infoL.txt

InfoL and InfoP are text files which store the contents of 2 text boxes. In this case txtLogin and txtPassword.
Could I save those files relative to the app I'm making? I dont really want to put it in a easy place to find the files for security purposes. Could I make the files hidden somehow?

Saving a password in plain text is never a good idea. No matter how well you think you have hidden it, somebody will find it. Its just to easy.
You need to encrypt the password with a one way system. That is once the password is encrypted, it cannot be decrypted - not without a lot of work.
To use the password you perform the same encryption on the password entered and compare the result with the saved encrypted version.
Have a look at this web site. It has an MD5 encryption DLL written for VB. Its fairly simple to use but will hide your password from all but the most detrmined of hackers.
http://userpages.umbc.edu/~mabzug1/cs/md5/md5.html
Stuart

![]() |
C/C++ decompiler
|
url capturing
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |