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

[IE类操作] 奇怪的登录问题,username的Value无法设置,密码的没问题[已解决]

  [复制链接]
发表于 2011-2-28 17:49:50 | 显示全部楼层 |阅读模式
本帖最后由 骗子 于 2011-3-2 18:08 编辑

问题已经找到了,多谢kevinch的帮助
将源文件没用的地方都去掉了,方便有类似经历的人查看
<form name="userLoginForm" method="post" action="/uac/authen/LoginAction.do;jsessionid=1600460938">
<input type="hidden" name="submitType" value="Login" />
<input type="hidden" name="mac"/>
<input type="hidden" name="IpAddress"/>
<input type="hidden" name="UserName"/>
<input type="hidden" name="ComputerName"/>
<input type="hidden" name="CPUSerial"/>
<span class="STYLE8">用 户 名</span>
<input type="text" name="username" maxlength="20" size="20" value="" class="input02">
<span class="STYLE8">口令</span>
<input type="password" name="password" maxlength="20" size="20" value="" onkeydown="if(event.keyCode==13){confirm();}" class="input02">
</form>
$oForm = _IEFormGetObjByName ($oIE, "userLoginForm") 
$oQuery = _IEFormElementGetObjByName ($oForm, "username") ;name="UserName"有两个au3好像没区分大小写,而需要的应该是第二个
_IEFormElementSetValue ($oQuery, "123123")  ;这里实际上是把第一个的改了,所以从IE上看用户名框设置不了,也不报错,
$oQuery = _IEFormElementGetObjByName ($oForm, "password")
_IEFormElementSetValue ($oQuery, "321321")  ;密码设置没问题
 楼主| 发表于 2011-3-1 11:04:53 | 显示全部楼层
自己顶一下,
$oForm = _IEFormGetObjByName ($oIE, "userLoginForm")
$oQuery = _IEFormElementGetObjByName ($oForm, "username")
_IEFormElementSetValue ($oQuery, "123123")  ;用户名框设置不了,也不报错
$oQuery = _IEFormElementGetObjByName ($oForm, "password")
_IEFormElementSetValue ($oQuery, "321321")  ;密码设置有效题
哪位大大能帮一下啊,谢谢了
发表于 2011-3-1 13:00:54 | 显示全部楼层
自己顶一下,哪位大大能帮一下啊,谢谢了
骗子 发表于 2011-3-1 11:04

_IEFormElementSetValue ($oQuery, "123123",0)
试一下

评分

参与人数 1金钱 +10 收起 理由
骗子 + 10 已经试过了,无效

查看全部评分

 楼主| 发表于 2011-3-1 16:28:21 | 显示全部楼层
$oQuery = _IEFormElementGetObjByName ($oForm, "username")
$oQuery.VALUE="123123"
也无效果
发表于 2011-3-1 17:54:40 | 显示全部楼层
网址链接出来给大家看看呗
 楼主| 发表于 2011-3-2 09:06:18 | 显示全部楼层
回复 5# kevinch
内网网址,此网页的源代码在一楼
发表于 2011-3-2 11:43:45 | 显示全部楼层
$oForm = _IEFormGetObjByName ($oIE, "userLoginForm")
$oQuery = _IEFormElementGetObjByName ($oForm, "username",1)  ;因为有两个username项,所以要用索引指定是第二个
_IEFormElementSetValue ($oQuery, "123123")  
$oQuery = _IEFormElementGetObjByName ($oForm, "password")
_IEFormElementSetValue ($oQuery, "321321")

评分

参与人数 1金钱 +20 收起 理由
骗子 + 20 搞定,谢谢了

查看全部评分

 楼主| 发表于 2011-3-2 15:15:33 | 显示全部楼层
kevinch 发表于 2011-3-2 11:43

真是麻烦你了,谢谢
$oQuery = _IEFormElementGetObjByName ($oForm, "username",1)  ;因为有两个username项,所以要用索引指定是第二个
username项是不是<input type="hidden" name="UserName"/> 这个?
_IEFormElementGetObjByName 不带区分大小写的?
发表于 2011-3-2 15:36:24 | 显示全部楼层
看目前的情况是不区分,不过不知道au3有没有类似vb里的option compare text这样的设定功能,可以规定匹配时是否区分大小写
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-12 02:11 , Processed in 0.086153 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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