hsyl4125 发表于 2014-11-5 21:52:47

GUI界面里面打开两个不同网页

本人想通过在一个GUI界面里面打开两个监控页面,可以自动登录,但是自己尝试半天只能打开一个,同时打开两个总会覆盖掉第一个,请高手支招!
账号密码是错的,请忽略,提供思路即可 {:face (303):}
第一个监控:http://wridc123.com
第二个监控:http://www.xjcdata.com#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
$mainwindow = GUICreate("监控服务器", @DesktopWidth, @DesktopHeight)
GUISetState(@SW_SHOW);窗口可见
$oIE = _IECreateEmbedded()
$GUIX=GUICtrlCreateObj($oIE, 0, -200, @DesktopWidth,600)
$uu=_IENavigate($oIE, "http://wridc123.com")
$oForm = _IEFormGetObjByName($oIE, "login")
$oQuery1 = _IEFormElementGetObjByName($oForm, "login_username")
_IEFormElementSetValue($oQuery1, "admin")
$oQuery2 = _IEFormElementGetObjByName($oForm, "login_password")
_IEFormElementSetValue($oQuery2, "123456")
_IEFormSubmit($oForm, 1)

While 1
      Sleep(1000) ; Idle around
WEnd

Exit

hsyl4125 发表于 2014-11-6 21:20:06

等了两天没有人解答,还是自己研究出来了{:face (270):}#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
$mainwindow = GUICreate("时代天元监控服务器", @DesktopWidth, @DesktopHeight)
GUISetState(@SW_SHOW);窗口可见

$oIE = _IECreateEmbedded()
$GUIX = GUICtrlCreateObj($oIE, 0, 0, @DesktopWidth, 400)
$uu = _IENavigate($oIE, "http://wridc123.com")
$oForm = _IEFormGetObjByName($oIE, "login")
$oQuery1 = _IEFormElementGetObjByName($oForm, "login_username")
_IEFormElementSetValue($oQuery1, "admin")
$oQuery2 = _IEFormElementGetObjByName($oForm, "login_password")
_IEFormElementSetValue($oQuery2, "123456")
_IEFormSubmit($oForm, 1)



$cactiez = _IECreateEmbedded()
$cactiezobj = GUICtrlCreateObj($cactiez, 0, 500, @DesktopWidth, 100)
_IENavigate($cactiez, "http://www.xjcdata.com", 1)
$cactiezform = _IEFormGetObjByName($cactiez, "login")
$form1 = _IEFormElementGetObjByName($cactiezform, "login_username")
_IEFormElementSetValue($form1, "admin")
$form2 = _IEFormElementGetObjByName($cactiezform, "login_password")
_IEFormElementSetValue($form2, "12345678")
_IEFormSubmit($cactiezform, 1)






While 1
        Sleep(1000) ; Idle around
WEnd

Exit

tank 发表于 2015-4-12 23:29:53

学习,谢谢楼主!

ebhb 发表于 2015-4-21 23:45:15

学习了,正在找这个资料。

z7c9 发表于 2015-5-19 17:49:05

thanks 4 sharing!

cfanpc 发表于 2016-11-16 19:43:57

这个好以后用得上

imutraveler 发表于 2017-2-13 14:18:57

收藏学习下

449199199 发表于 2018-3-26 11:22:13

@DesktopWidth, 100)
修改为
@DesktopWidth, @Desktopheight/2)

nybb 发表于 2023-2-22 11:45:03

学习学习.,
页: [1]
查看完整版本: GUI界面里面打开两个不同网页