找回密码
 加入
搜索
查看: 4422|回复: 8

[GUI管理] 如何将GUI中文本框内容填入内嵌IE,并判断是否成功登录

  [复制链接]
发表于 2014-12-29 21:08:57 | 显示全部楼层 |阅读模式
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <IE.au3>
#include <Debug.au3>
$oIE = ObjCreate("Shell.Explorer.2")
$Form1 = GUICreate("IE", 400, 300, -1, -1)
$GUIActiveX = GUICtrlCreateObj($oIE, -1, -1, 300, 300)
$oIE.navigate("http://weifang.1k100.com/")
$Input1 = GUICtrlCreateInput("用户名", 300, 10, 100, 20)
$Input2 = GUICtrlCreateInput("密码", 300, 50, 100,20)
$Button1 = GUICtrlCreateButton("点击登录", 300, 80, 100, 30)
 GUISetState(@SW_SHOW)      

        While 1
                $msg = GUIGetMsg()
                Select
                    Case $msg = $GUI_EVENT_CLOSE
                        Exit
                    Case $msg =$Button1 
                            
                                          MsgBox(0,"提示","登录成功!")
                EndSelect
        WEnd
Exit

;~ $UserName = _IEGetObjById ($oIE, "LoginName")
;~ $UserName.value = "123456789012345678"

;~ $PassWord = _IEGetObjById ($oIE, "Password") 
;~ $PassWord.value = "1111111"

;~ $Submit = _IEGetObjById ($oIE, "loginbtn")
;~ $Submit.submit
上面的是大致的代码,请各位指点一下,如何将GUI文本框内容填入内嵌IE,并判断是否成功登录,登录成功后返回成功,失败时显示错误,谢谢。
发表于 2014-12-29 22:09:31 | 显示全部楼层
帮你顶高起来,我也比较想知道答案。感觉这个用来做自动登陆器,是必须要用到的。
 楼主| 发表于 2014-12-30 09:05:03 | 显示全部楼层
大侠们都很忙啊,没人可以指点一下吗?
 楼主| 发表于 2014-12-30 10:18:13 | 显示全部楼层
想到一种方法判断是搜索源代码中的字符串是否有注销两字,但是需要用到正则表达式,不会表示,哪位指点一下?
$str=_iebodyreadhtml($OIE)
stringregexp($STR,"注销",0)
这样好你不行,不知道咋改了,见到的老兄们指点一下吧?谢了。
发表于 2014-12-30 10:22:22 | 显示全部楼层
post或get有返回值,
 楼主| 发表于 2014-12-30 13:56:00 | 显示全部楼层
post或get有返回值,
zhouein 发表于 2014-12-30 10:22

可否细点指导一下?谢谢。
发表于 2014-12-30 23:49:33 | 显示全部楼层
IE操作太慢,还是post~~
 楼主| 发表于 2015-1-19 16:42:39 | 显示全部楼层
IE操作太慢,还是post~~
haijie1223 发表于 2014-12-30 23:49



    不懂啊,老兄帮忙写个示例学习一下吧?
发表于 2015-1-19 18:00:21 | 显示全部楼层
想知道答案
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-28 22:05 , Processed in 0.076618 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表