chandan029 Posted April 22, 2009 Posted April 22, 2009 Hi all, I have to pass the username and password stored in of the .txt file in my system to the autoit file. i m tryin to automate gmail. i dont want to store it directly as a variable within . iI there any way to pass these information directly or a way by which i can pass the content of my file as a variable to autoit and then use it...Thanx.
MHz Posted April 23, 2009 Posted April 23, 2009 Hi,An ini file is a txt file that is structured to get and/or store information easily so I would be recommending that method to you unless you have special needs.example code; ini file name to use$file_ini = 'my program settings.ini'; create ini file if not existsIf Not FileExists($file_ini) Then IniWrite($file_ini, 'gmail', 'username', '') IniWrite($file_ini, 'gmail', 'password', '')EndIf; read ini file values form gmail section$username = IniRead($file_ini, 'gmail', 'username', '')$password = IniRead($file_ini, 'gmail', 'password', ''); show resultMsgBox(0, Default, '$username = ' & $username & @CRLF & '$password = ' & $password); example of checking for non empty values for both valuesIf $username <> '' And $password <> '' Then MsgBox(0, Default, 'both variables have values worth using')EndIf
chandan029 Posted May 3, 2009 Author Posted May 3, 2009 Hey.. Thanks a lot... i used FILEREAD and READLINE to do the job but ur Information was something new and i ll try to work as per ur example... Regards
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