找回密码
 加入
搜索
查看: 3907|回复: 4

[网络通信] 163邮箱登录不成功

[复制链接]
发表于 2010-7-17 17:35:16 | 显示全部楼层 |阅读模式
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
$Form1 = GUICreate("邮箱登录器",700,480)

$Input1 = GUICtrlCreateInput("Input1", 184, 88, 161, 21)
$Input2 = GUICtrlCreateInput("Input2", 200, 108, 161, 21)
$Button1 = GUICtrlCreateButton("登陆", 208, 160, 105, 33)
GUISetState(@SW_SHOW)
While 1          
        $nMsg = GUIGetMsg()
        Switch $nMsg                       
                Case $GUI_EVENT_CLOSE
                        Exit
                           Case $Button1
                                   $oIE = _IECreateEmbedded ()
$GUIActiveX = GUICtrlCreateObj($oIE,16, 24, 668, 374)
$oIE.navigate("http://mail.163.com")
$oform = _IEGetObjById ($oIE, "login163")                               
$oQuery1 = _IEFormElementGetObjByName ($oform, "username");
_IEFormElementSetValue ($oQuery1,GUICtrlRead ($Input1));
$oQuery2 = _IEFormElementGetObjByName ($oform, "password")
_IEFormElementSetValue ($oQuery2,GUICtrlRead ($Input2));  
_IEFormSubmit ($oform,0)
        EndSwitch
WEnd
发表于 2010-7-17 20:04:48 | 显示全部楼层
对于许多HTML表单
_IEFormSubmit() 可能不起作用因为经常是通过JS脚本获取点击事件来点击提交按钮.
在这种情况下你需要模拟一个点击动作代替使用 _IEFormSubmit().
参阅 _IEAction() 有关"click"动作的例子
或参考此文
http://www.autoitx.com/thread-16964-1-1.html

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2010-7-18 10:23:35 | 显示全部楼层
参阅 _IEAction() 有关"click"动作的例子
发表于 2010-7-18 15:09:22 | 显示全部楼层
感谢2楼解答,学习
发表于 2010-7-18 23:30:16 | 显示全部楼层
恩,这里需要用到_IEAction() ,能够解决!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-17 06:30 , Processed in 0.081904 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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