替换整个网页(文档)的HTML代码.
#include <IE.au3>
_IEDocWriteHTML ( ByRef $o_object, $s_html )
$o_object | InternetExplorer.Application, 窗口或框架(frame)对象的对象变量 |
$s_html | 写入文档的HTML代码 |
成功: | 返回-1 |
失败: | 返回 0 并且设置 @ERROR |
@Error: | 0 ($_IEStatus_Success) = 无错误 |
1 ($_IEStatus_GeneralError) = 一般性错误 | |
3 ($_IEStatus_InvalidDataType) = 无效数据类型 | |
4 ($_IEStatus_InvalidObjectType) = 无效对象类型 | |
6 ($_IEStatus_LoadWaitTimeout) = 载入等待超时 | |
8 ($_IEStatus_AccessIsDenied) = 访问被拒绝 | |
9 ($_IEStatus_ClientDisconnected) = 客户端断开 | |
@Extended: | 包含无效参数数量 |
; *******************************************************
; 示例 1 - 创建空浏览器, 写入自定义的 HTML 代码 - 此时
; FRAMESET - 然后更新每个框架的内容
; *******************************************************
#include <IE.au3>
Local $oIE = _IECreate()
Local $sHTML = ""
$sHTML &= "<HTML>" & @CR
$sHTML &= "<HEAD>" & @CR
$sHTML &= "<TITLE>_IE_Example('frameset')</TITLE>" & @CR
$sHTML &= "</HEAD>" & @CR
$sHTML &= "<FRAMESET rows='25,200'>" & @CR
$sHTML &= " <FRAME NAME=Top SRC=about:blank>" & @CR
$sHTML &= " <FRAMESET cols='100,500'>" & @CR
$sHTML &= " <FRAME NAME=Menu SRC=about:blank>" & @CR
$sHTML &= " <FRAME NAME=Main SRC=about:blank>" & @CR
$sHTML &= " </FRAMESET>" & @CR
$sHTML &= "</FRAMESET>" & @CR
$sHTML &= "</HTML>"
_IEDocWriteHTML($oIE, $sHTML)
_IEAction($oIE, "refresh")
Local $oFrameTop = _IEFrameGetObjByName($oIE, "Top")
Local $oFrameMenu = _IEFrameGetObjByName($oIE, "Menu")
Local $oFrameMain = _IEFrameGetObjByName($oIE, "Main")
_IEBodyWriteHTML($oFrameTop, '$oFrameTop = _IEFrameGetObjByName($oIE, "Top")')
_IEBodyWriteHTML($oFrameMenu, '$oFrameMenu = _IEFrameGetObjByName($oIE, "Menu")')
_IEBodyWriteHTML($oFrameMain, '$oFrameMain = _IEFrameGetObjByName($oIE, "Main")')