#include <IE.au3>
#include <Date.au3>
$file_ok=@TempDir & "\ESET_30天临时ID.txt"
DirCreate($file_ok)
$browser_old='"C:\Program Files\Internet Explorer\iexplore.exe" -nohome'
$temp_Email="xx88@eset.qc.to"
$IE = _IECreate("http://www.eset.eu/download/ess-trial-form")
$oFrames = _IEFrameGetCollection($IE)
$iNumFrames = @extended
For $i = 0 To ($iNumFrames - 1)
$oFrame = _IEFrameGetCollection($IE, $i)
; MsgBox(0, "Frame Info", _IEPropertyGet ($oFrame, "locationurl"))
Next
;$oIE = _IECreate(_IEPropertyGet($oFrame, "locationurl"))
;-------------正在打开内嵌框架网页---------------------
TrayTip("【精睿·网络安全】", "正在提交给ESET.... ", 35, 1)
FileWriteLine($file_ok, "【"& _Now() & "】"& "得到申请ID页面内置框架地址,正在打开页面并提交数据..."& @CRLF)
$oIE = _IECreate (_IEPropertyGet ($oFrame, "locationurl"))
$T = _IEBodyReadText($oIE)
;MsgBox(64, $oIE,$T)
;MsgBox(64, $oIE,StringInStr($T, "Email.:" ))
If StringInStr($T, "Email.:") = 0 Then
;if @ERROR then
TrayTip("错误", "无法连接到ESET Trial 30天ID内嵌申请页面!,3秒后退出", 5, 3)
FileWriteLine($file_ok, "【"& _Now() & "】"& "错误,无法连接到ESET Trail 30天ID内嵌申请页面!" & @CRLF)
RegWrite("HKEY_CLASSES_ROOT\http\shell\open\command", "", "REG_SZ", $browser_old)
FileWriteLine($file_ok, "【"& _Now() & "】"& "本机默认浏览器程序恢复为" & $browser_old & @CRLF)
FileWriteLine($file_ok, "【"& _Now() & "】"& "程序运行结束" & @CRLF)
FileWriteLine($file_ok, "*********************************************************")
FileClose($file_ok)
sleep(2000)
_IEQuit ($oIE)
_IEQuit ($IE)
Run("notepad.exe ESET_30天临时ID.txt")
Exit
EndIf
$oForms = _IEFormGetCollection ($oIE)
$iNumForms = @extended
;MsgBox(0, "Forms Info", "There are " & $iNumForms & " forms on this page")
;-------------得到表单名称---------------------
For $i = 0 to $iNumForms - 1
$oForm = _IEFormGetCollection ($oIE, $i)
;MsgBox(0, "Form Info", $oForm.name)
Next
;-------------从表单遍历表单元素---------------------
$oForm = _IEFormGetObjByName ($oIE, $oForm.name)
$oQuerys = _IEFormElementGetCollection ($oForm)
For $Query In $oQuerys
TrayTip("表单控件信息", "名称:"& $Query.name & " 类型:"&$Query.type,3,1)
;FileWriteLine($file_ok, "【"& _Now() & "】"& "表单控件信息:名称:"& $Query.name & " 类型:"&$Query.type & @CRLF)
;-------------如果元素类型为“Text”,则填入临时邮件地址---------------------
If $Query.type = "Text" then
$oText = _IEFormElementGetObjByName ($oForm, $Query.name)
_IEFormElementSetValue ($oText, $temp_Email)
EndIf
Next
;-------------如果元素类型为“submit”,则将此元素名称付给$submit_name,以便提交表单--------------------
If $Query.type = "submit" then $submit_name=$Query.name
Next
;-------------提交表单--------------------
;_IEAction ($oForm, "click")
$OK = _IEGetObjByID($oIE, $submit_name);通过工具查询到得登陆按钮ID值,,,,
IE9中无效。
$OK.click ;点击提交按钮,,,,IE9中无效。
TrayTip("【精睿·网络安全】", "提交完毕,正在等待ESET回复....", 35, 1)
FileWriteLine($file_ok, "【"& _Now() & "】"& "提交完毕,正在等待ESET回复.... "& @CRLF)
_IELoadWait ($oIE)