Computing.Net > Forums > Programming > what's wrong with this code?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

what's wrong with this code?

Reply to Message Icon

Name: ben
Date: November 8, 2003 at 01:33:53 Pacific
OS: win98Se
CPU/Ram: pentium III, 512 MB
Comment:

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 Sub

Private 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




Sponsored Link
Ads by Google

Response Number 1
Name: davour
Date: November 8, 2003 at 06:02:25 Pacific
Reply:

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 so

its c:\texts\infoL.txt


0

Response Number 2
Name: ben
Date: November 8, 2003 at 17:34:23 Pacific
Reply:

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?


0

Response Number 3
Name: Stuart
Date: November 8, 2003 at 18:39:28 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


C/C++ decompiler url capturing



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: what's wrong with this code?

what's wrong with my batch file? www.computing.net/answers/programming/whats-wrong-with-my-batch-file/19477.html

What is wrong with this ASP code? www.computing.net/answers/programming/what-is-wrong-with-this-asp-code/5324.html

bad counter coding www.computing.net/answers/programming/bad-counter-coding/8076.html