Skip to content

Instantly share code, notes, and snippets.

@adil1214
Created December 20, 2018 22:57
Show Gist options
  • Select an option

  • Save adil1214/8bb1e4c99226db355d28edf7b48201c6 to your computer and use it in GitHub Desktop.

Select an option

Save adil1214/8bb1e4c99226db355d28edf7b48201c6 to your computer and use it in GitHub Desktop.
reading lines 2 by 2
user1
password1
user2
password2
user3
password3
user4
password4
user5
password5
user6
password6
eeee
ffffff
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <File.au3>
HotKeySet("{ESC}", "Terminate")
Global $sFilePath = "list.txt"
Main()
Func Main()
Local $hFileOpen = FileOpen($sFilePath, $FO_READ)
If $hFileOpen = -1 Then
MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
Return False
EndIf
$line = 1
$TotalLines = _FileCountLines($sFilePath)
Local $username, $password
While $line < $TotalLines
$username = FileReadLine($hFileOpen, $line)
$password = FileReadLine($hFileOpen, $line+1)
MsgBox($MB_SYSTEMMODAL, "", "USERNAME: " & $username & @CRLF & "PASSWORD: " & $password )
$line += 2
WEnd
FileClose($hFileOpen)
EndFunc
Func Terminate()
Exit
EndFunc ;==>Terminate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment