我正在编写 AutoIT 脚本以从文件中读取用户名和密码,以减少部署的痛苦,否则我必须为每个部署提供用户名和密码。我是 AutoIT 的新手,我只是 RTFM,以下是我得到的,因为我是新手,我敢肯定你可以找到我做错的事情,但以下是为我做的工作以比这个问题之前回答的更好的方式:
Local $sLauncherPath = "C:\Program Files (x86)\Google\google_appengine\launcher\GoogleAppEngineLauncher.exe"
Local $iPid = Run($sLauncherPath)
Local $hWin
While ProcessExists($iPid)
$hWin = WinWait("Deploy Application to Google", "", 1)
Local $file = FileOpen("C:\Program Files (x86)\Google\google_appengine\launcher\settings.dat", 0)
Local $line = FileReadLine($file, 1)
Local $line2 = FileReadLine($file, 2)
If $hWin And WinGetProcess($hWin) = $iPid Then
ControlSetText($hWin, "", "Edit1", $line)
ControlSetText($hWin, "", "Edit2", $line2)
ControlClick($hWin, "", "Button2")
WinWaitClose($hWin)
EndIf
WEnd
它似乎对我有用,由于这只是我的第二个 AutoIT 项目,您能否提出可能的改进建议?