找回密码
 加入
搜索
查看: 2381|回复: 3

[IE类操作] [已解决]求助。这个弹出窗口的确定要怎么点击?

[复制链接]
发表于 2015-2-8 17:26:33 | 显示全部楼层 |阅读模式
本帖最后由 tspmy 于 2015-2-9 09:59 编辑



<HTML>
<HEAD>
<META http-equiv="Pragma" content="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>System | Configuration Tools</TITLE>
<SCRIPT language=JavaScript src="gozila.js"></SCRIPT>
<SCRIPT language=JavaScript src="menu.js"></SCRIPT>
<SCRIPT language=JavaScript src="table.js"></SCRIPT>
<script language="JavaScript">
var lanip = "192.168.7.11";
var time = 0;
var pc = 0;

function init(f)
{
        ;
}

function preSubmit() {
        if(window.confirm("大约50秒后系统会重新链接至首页。"))
        {       
                document.frmSetup.style.cursor = "wait";
                document.getElementById("rebootBtn").disabled = true;
            var code = "/goform/SysToolReboot";
                var request = GetReqObj();
                request.open("GET", code, true);
                request.onreadystatechange = RequestRes;
                request.setRequestHeader("If-Modified-Since","0");
                request.send(null);       
                reboot();
        }
        else
                return;

}

function RequestRes()
{
       
}

function reboot()
{
        pc+=1;

        if (pc > 100)
        {
                window.top.location = "http://" + lanip;
                document.frmSetup.style.cursor = "auto";
                clearTimeout(time);
                return;
        }
        setWidth(self, "lpc", pc + "%");
        document.getElementById("percent").innerHTML = pc + "%"
        time = setTimeout("reboot()",500);
}

function setWidth(windowObj, el, newwidth)
{
    if (document.all)
        {
          if (windowObj.document.all(el) )
        windowObj.document.all(el).style.width = newwidth ;
        }
        else if (document.getElementById)
        {
          if (windowObj.document.getElementById(el) )
            windowObj.document.getElementById(el).style.width = newwidth;
        }
}

</SCRIPT>
<link rel=stylesheet type=text/css href=style.css>
</HEAD>

<BODY leftMargin=0 topMargin=0 MARGINHEIGHT="0" MARGINWIDTH="0" onLoad="init(document.frmSetup);" class="bg">
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="33">&nbsp;</td>
        <td width="679" valign="top">
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" height="100%">
          <tr>
            <td align="center" valign="top">
                        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" height="100%">
              <tr>
                <td align="center" valign="top">
                               
                                <form name=frmSetup method="POST" action=/goform/SysToolReboot>
                                <INPUT type=hidden name=CMD value=SYS_CONF>
                                <INPUT type=hidden name=GO value=system_reboot.asp>
                                <INPUT type=hidden name=CCMD value=0>
                                <table cellpadding="0" cellspacing="0" class="content2">
                            <tr><td colspan=2 valign="top">&nbsp;&nbsp;单击此按钮将使AP重新启动。</td>
                            </tr>
                                </table>
                                <table cellpadding="0" cellspacing="0" class="content3" id="table1">
                                        <tr><td width="30%">
                                        &nbsp;&nbsp;<input class="button2" onClick="preSubmit()" value="重启系统" type="button" onMouseOver="style.color='#FF9933'" onMouseOut="style.color='#000000'"  id="rebootBtn">
                                        </td><td height="30" id="percent" style="font-size:24px"></td>
                                        </tr>       
                                               
                                <tr> <TD align="left" width="400" colspan="2">
                                <table width="100%" align="left" bgcolor="#ffffff" cellpadding="0" cellspacing="0" bordercolor="#999999" id="AutoNumber19" style="border-style: solid; border-width: 1px; margin-left:5px; margin-top:5px;">
                           <tr>
                                <td align=left>
                                <table id=lpc bgcolor="#3366CC" height=20>
                                <tr>
                                  <td></TD>
                                </TR>
                                </table>
                           </TD>                               
                           </TR>
                           </table>
                                </TD>
                                </tr>
                                </table>
                        </FORM>
                                </td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td align="center" valign="top" height="100%">
                <script>helpInfo('重启系统将使所改变的设置生效。在重启时,会自动断开所有连接,点击“确定”即可重启。'
                );</script>

                </td>
      </tr>
    </table>
        <script type="text/javascript">
          table_onload('table1');
    </script>
</BODY>
</HTML>












#include<IE.au3>
$oIE = _IECreate ("http://192.168.7.21")
$oForm = _IEFormGetObjByName ($oIE, "Login")
$oQuery = _IEFormElementGetObjByName ($oForm, "Password")
_IEFormElementSetValue ($oQuery, "meiyoumima")
_IEFormSubmit($oForm)
_IELinkClickByText($oIE,"高级设置")
_IELinkClickByText($oIE,"系统工具")
_IELinkClickByText($oIE,"重启系统")
$oIE = _IEFrameGetObjByName($oIE,"mainFrame")
$Ele = _IEGetObjById($oIE,"rebootBtn")
_IEAction($Ele,"click") ;点击

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2015-2-8 18:02:15 | 显示全部楼层
#include<IE.au3>
#include "CoProc.au3"
$oIE = _IECreate ("http://192.168.7.21")
$oForm = _IEFormGetObjByName ($oIE, "Login")
$oQuery = _IEFormElementGetObjByName ($oForm, "Password")
_IEFormElementSetValue ($oQuery, "meiyoumima")
_IEFormSubmit($oForm)
_IELinkClickByText($oIE,"高级设置")
_IELinkClickByText($oIE,"系统工具")
_IELinkClickByText($oIE,"重启系统")
$PIDok=_CoProc("_ok")

$oIE = _IEFrameGetObjByName($oIE,"mainFrame")
$Ele = _IEGetObjById($oIE,"rebootBtn")
_IEAction($Ele,"click") ;点击
Sleep(5000)

ProcessClose($PIDok)

Func _ok();这是子进程代码,必须是一个函数

        While 1

                                Sleep(200)

                                                                Send("{ENTER}")

                                

        WEnd

EndFunc   ;==>_ok
这样解决的
发表于 2015-2-9 09:05:39 | 显示全部楼层
学习了,感谢分享!
 楼主| 发表于 2015-2-9 09:32:43 | 显示全部楼层
还有木有更稳定的方法?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-6 02:03 , Processed in 0.075405 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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