Jump to content

how to pass a user name and password


Recommended Posts

Hello All,

 

I am new to this auto it and i am trying to automate some thing by using this auto it,My requirement is take the user name and password from the text file and pass it through the application,Just like multiple users login in to the  gmail account  with different user name and password.

Thanks in Advance .

Regards

Sriharsha

Link to comment
Share on other sites

$file = FileOpen(@workingdir & "\user.txt",0) ;Opens the file in the background, So we can access the data
$read = FileRead($file) ; Reads the contents of the file.
$array = StringSplit($read,":") ; Seperates the contents of the file by the chosen delimiter. (ie, We now have $array[1] as the username and $array[2] as the passwordof the txt file.
$username = $array[1]
$password = $array[2]
Msgbox(0,"User Details","Username: " & $username & @CR & "Password: " & $password) ;Display the result.

Play around with the FileOpen and Read commands as Geir said.

I personally find that loading contents of a file into an array makes data validation/manipulation far easier.

For your reference, Here is the txt file i used in this example
 

jack:jill

-Javi

give a man an application, and he'll be frustrated for the day, Teach him how to program applications and he'll be frustrated for a lifetime.

Link to comment
Share on other sites

Hello All,

 

I am new to this auto it and i am trying to automate some thing by using this auto it,My requirement is take the user name and password from the text file and pass it through the application,Just like multiple users login in to the  gmail account  with different user name and password.

Thanks in Advance .

Regards

Sriharsha

Hi Sriharsha8845,

First of all welcome to AutoIT.

I advice you to start by gettin familiar to AutoIT in forums, helpfile and lose some hours writing a script., After doing that, post what you tried to script and all AutoIT comunity will help you gladly.

For your intent, probably if you give mor details, about aplication (web application, desktop application, etc...) probably we can give you more hints to start scripting.

Best of luck and have a nice script day

Edited by November

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

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...