#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.12.0
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <FileConstants.au3>
#include <File.au3>
;=======================================================
; editiere mich !!!
;=======================================================
global $LOGIN_DB[10][2]
$LOGIN_DB[0][0] = "USER1"
$LOGIN_DB[0][1] = "PASS1"
$LOGIN_DB[1][0] = "USER2"
$LOGIN_DB[1][1] = "PASS2"
$LOGIN_DB[2][0] = "USER3"
$LOGIN_DB[2][1] = "PASS3"
; usw...
;=======================================================
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("apBuilder", 602, 287, 192, 206)
$User =GUICtrlCreateInput("", 208, 152, 193, 21)
$Password =GUICtrlCreateInput("", 208, 184, 193, 21)
$Button1 = GUICtrlCreateButton("Login", 264, 224, 81, 33, $WS_GROUP)
$Group1 = GUICtrlCreateGroup("Group1", -8, 784, 345, 41)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateLabel("User:", 176, 152, 26, 17)
GUICtrlCreateLabel("Password:", 152, 184, 50, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Login()
EndSwitch
WEnd
func Login()
For $i = 0 To $LOGIN_DB[0][0]
;MsgBox(0, "", "USER: " & $aArray[$i][0] & @CRLF & "PASSWORD: " & $aArray[$i][1])
if GUICtrlRead($User) = $LOGIN_DB[$i][0] And GUICtrlRead($Password) = $LOGIN_DB[$i][1] then
BuildAPK()
Else
MsgBox(0,"LOGIN","Accountdaten wurden nicht gefunden.")
EndIf
Next
EndFunc
Func Random_str($size)
Local $sText = ""
For $i = 1 To $size
$sText &= Chr(Random(65, 122, 1))
Next
Return $sText
EndFunc ;==>Example
func BuildAPK()
Local $sFilePath = @ScriptDir & "\servertool.apk"
Local $hFile
if _FileCreate($sFilePath) then
$hFile = FileOpen($sFilePath, $FO_APPEND)
If $hFile Then
$sRandomText = Random_str(1024)
For $i = 0 To 1024
FileWrite($hFile, $sRandomText)
Next
FileClose($hFile)
MsgBox(0,"BUILD","OK")
EndIf
EndIf
EndFunc
Entsprechende Zeilen editieren und mit autoit kompilieren!
Fertig.
Bearbeitet von Ar@m!s, 20 September 2015 - 20:33 Uhr.