MSFN Forum: how to pass content with in file as a parameter - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

Welcome to the Applications Installs forum. Make sure you read the forum rules before you start posting.

Links/Requests to warez and/or any illegal material (porn, cracks, serials, etc..) will not be tolerated. Discussion of circumventing WGA/activation/timebombs/keygens or any other illegal activity will also not be tolerated.

We try our best to keep this forum clean of illegal content. If you see any illegal activity use the "report" button you find in every post to report the specific post to the moderators. If you ignore any of the rules you will be banned without notice.

Read Forum Rules
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

how to pass content with in file as a parameter Rate Topic: -----

#1 User is offline   chandan029 

  • Group: Members
  • Posts: 3
  • Joined: 06-April 09

Posted 21 April 2009 - 11:08 PM

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.


#2 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

  Posted 23 April 2009 - 12:33 AM

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 exists
If 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 result
MsgBox(0, Default, '$username = ' & $username & @CRLF & '$password = ' & $password)

; example of checking for non empty values for both values
If $username <> '' And $password <> '' Then
	MsgBox(0, Default, 'both variables have values worth using')
EndIf
 


#3 User is offline   chandan029 

  • Group: Members
  • Posts: 3
  • Joined: 06-April 09

Posted 03 May 2009 - 02:50 PM

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy