Created
December 20, 2018 22:57
-
-
Save adil1214/8bb1e4c99226db355d28edf7b48201c6 to your computer and use it in GitHub Desktop.
reading lines 2 by 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user1 | |
| password1 | |
| user2 | |
| password2 | |
| user3 | |
| password3 | |
| user4 | |
| password4 | |
| user5 | |
| password5 | |
| user6 | |
| password6 | |
| eeee | |
| ffffff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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