Jump to content

Help reading a login and password test file


glarson
 Share

Recommended Posts

I am trying to create a text file that contains login name and password. I want to then read the file and display the login name and password in a message box. Here is the code I have come up with. It creates the file just fine, when you open the text file the login and password data is there, But it won't display that data in a message box.

Any ideas on what I am missing??

CODE
$file=FileOpen("G:\Audit scripts\Bot tests\With login option\Eve Login Info.txt",2)

$login=InputBox("Eve Online","Enter Login Name","")

$passwd = InputBox("Eve Online", "Enter your password.", "", "*")

FileWrite($file,$login & @CRLF & $passwd)

FileClose($file)

FileOpen($file,0)

$lgin=FileReadLine($file,1)

$pswrd=FileReadLine($file,2)

MsgBox(0,"Eve Login",$lgin,200)

MsgBox(0,"Eve Password",$pswrd,200)

Link to comment
Share on other sites

lol better hope no one looks through your files lol, your login and password are right there. xD

Next step = encryption. :)

#include <String.au3>
_SctringEncrypt(1, "Eve Password", "encrypt password", 4)

;1 to encrypt teh string, 0 to decrypt. 4 is encrypt lvl, 4 is good. ;)

Yeh yeh yeh, that way the only time you see the actual user name / password is in the program if you had a msgbox, or the script itself typing for you. ^^

Link to comment
Share on other sites

If the file is the username, followed by @CRLF and password, then you might be able to retrieve the two variables by doing something along these lines:

$filetext = FileRead("Eve Login Info.txt")

$fileuserpass = StringSplit($filetext, @CRLF)

$fileuserpass[1] = the username,

$fileuserpass[2] = the password.

You could go on from there. But INIWrite is worth learning too, especially if you want to have a professionally designed configuration file in the future. (I used a simple set of numbers for older versions of my programs too, but an INI-style file makes the clever end-user feel warm and fuzzy on the inside should they stumble upon it.)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...