找回密码
 加入
搜索
查看: 11979|回复: 11

[已成交] IE表单操作(或后台POST)(多框架镶嵌)

 火.. [复制链接]
发表于 2009-12-5 10:53:40 | 显示全部楼层 |阅读模式
悬赏200金钱未解决
本帖最后由 破帽遮颜 于 2009-12-10 19:53 编辑
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=C:\Users\Sxd\Desktop\webChat.kxf
$Form1 = GUICreate("WebChat", 624, 126, 215, 169)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Label1 = GUICtrlCreateLabel("网友", 8, 8, 28, 17)
$Input1 = GUICtrlCreateInput("", 40, 8, 121, 21)
$Label2 = GUICtrlCreateLabel("对", 176, 8, 16, 17)
$Input2 = GUICtrlCreateInput("", 200, 8, 121, 21)
$Label3 = GUICtrlCreateLabel("说:", 8, 40, 19, 17)
$Edit1 = GUICtrlCreateEdit("", 40, 40, 281, 65)
$Checkbox1 = GUICtrlCreateCheckbox("悄悄话", 336, 8, 57, 17)
$Button1 = GUICtrlCreateButton("Send", 336, 40, 75, 57, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Const $sWebChatURL = 'http://127.0.0.1:1055/chat.htm'
$oIE = _IECreate($sWebChatURL)
Sleep(5000)

$oMain = _IEFrameGetCollection($oIE, 0)
$oIFrame = _IEFrameGetObjByName($oMain, 'speak')


$oUserName = _IEGetObjByName($oIFrame, 'username')
$oSayTo = _IEGetObjByName($oIFrame, 'sayto')
$oStealth = _IEGetObjByName($oIFrame, 'stealth')
$oEditWord = _IEFrameGetObjByName($oIFrame, 'editword')
$oSpeak = _IEFormGetObjByName($oIFrame, 'speak')

While 1
        Sleep(100)
WEnd

Func Button1Click()
        ;悄悄话
        If GUICtrlRead($Checkbox1) = 1 Then
                $oStealth.checked = True
        Else
                $oStealth.checked = False
        EndIf
        ;网友
        $oUserName.value = GUICtrlRead($Input1)
        ;对谁说
        $oSayTo.value = GUICtrlRead($Input2)
        ;内容
        $oEditWord.document.body.innertext = GUICtrlRead($Edit1)
        ;发送
        _IEFormImageClick($oSpeak, 'send.gif')
EndFunc   ;==>Button1Click

Func Form1Close()
        Exit
EndFunc   ;==>Form1Close

发表于 2009-12-5 14:11:08 | 显示全部楼层
楼主是不是在写聊天软件?
发表于 2009-12-5 14:15:01 | 显示全部楼层
估计在某一天楼主会把这软件拿去赚钱,用于商业用途。
 楼主| 发表于 2009-12-5 14:19:55 | 显示全部楼层
楼上的,我是否用于商业与这悬赏有关联?另外规定商业用途的软件就不可以提问?
发表于 2009-12-5 17:26:33 | 显示全部楼层
没能力,飘过~~~
发表于 2009-12-7 18:39:34 | 显示全部楼层
发表于 2009-12-9 21:13:38 | 显示全部楼层
不能分享出来吗?
发表于 2009-12-10 01:13:50 | 显示全部楼层
能分享源码嘛
发表于 2009-12-10 09:53:36 | 显示全部楼层
回复 4# 破帽遮颜

猜测而已,楼主莫见怪
发表于 2009-12-11 12:53:57 | 显示全部楼层
看的一头雾水。。。
发表于 2009-12-23 22:46:30 | 显示全部楼层
本帖最后由 lifuxing8 于 2009-12-23 22:55 编辑

是不是获取不到框架内容对象?
一句代码就可以搞定:$ouserName=$oIE.document.frames.speak.username.value
把分给我吧,呵呵
不明白问我,qq:11093025,绝对能给你搞定
发表于 2010-1-20 01:34:40 | 显示全部楼层
完全不知道楼主在坐山么!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-20 18:43 , Processed in 0.075290 second(s), 17 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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