glarson Posted October 17, 2007 Share Posted October 17, 2007 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 More sharing options...
Developers Jos Posted October 17, 2007 Developers Share Posted October 17, 2007 Second FileOpen() needs the filename as first parameter not the old Handle.... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
glarson Posted October 17, 2007 Author Share Posted October 17, 2007 Second FileOpen() needs the filename as first parameter not the old Handle....Awsome! Thanks, it works now. Link to comment Share on other sites More sharing options...
Foy Posted October 18, 2007 Share Posted October 18, 2007 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 More sharing options...
DaProgrammer Posted October 18, 2007 Share Posted October 18, 2007 ur better off using iniwrite and read its easier Link to comment Share on other sites More sharing options...
RobertKipling Posted October 18, 2007 Share Posted October 18, 2007 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 More sharing options...
glarson Posted October 19, 2007 Author Share Posted October 19, 2007 So, How does you use the ini write/read work? I have not used that before. If I want to use it in a compiled script on any computer how would that work? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now