roma351234567890
Новичок
- Сообщения
 - 20
 
- Репутация
 - 0
 
Телнета нет, rasdial тут вроде тоже не катит. Модем китайский, wget-ом не получается, либо знаний не хватает, JS тоже нет знаний. 
Только средствами WebBrowser, а не IE. Никакие элементы не определяются, только Internet Explorer_Server1.
С помощью ControlClick сделал, но хочется более продвинутый вариант, который также будет примером для меня дальнейших подобных действий.
Входим в веб морду модема:
	
	
	
	
  
    
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
	
	
		
			
	
Справа от User Name: есть поле для логина
Справа от Password: есть поле для пароля
И подтвердить нажатием на Login. Нажатие на Login можно заменить на
	
	
	
	
  
    
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
но хочется примера правильного нажатия.
	
	
		
			
	
	
	
	
  
    
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
		
	
И как я понимаю, за нажатие на нужную кнопку отвечает строка:
	
	
	
	
  
    
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Которую и нужно нажать.
			
			Только средствами WebBrowser, а не IE. Никакие элементы не определяются, только Internet Explorer_Server1.
С помощью ControlClick сделал, но хочется более продвинутый вариант, который также будет примером для меня дальнейших подобных действий.
Входим в веб морду модема:
			
				Код:
			
		
		
		$Tit = "Веб-браузер"
$RadioR = ObjCreate("Shell.Explorer.2")
$RadioRambler = GUICreate($Tit, 1000, 636, -1, -1)
$GUIActiveX = GUICtrlCreateObj($RadioR, -1, -1, 1000, 636)
GUISetState(@SW_SHOW)
$RadioR.navigate("http://192.168.1.1/login.htm")
	<!DOCTYPE HTML>
<html>
<head>
<title>Router</title>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<link rel="stylesheet" href="reset.css">
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="style.css">
<script language=javascript>
function onlogin() {
if(document.test.username.value.length <= 0) {
alert("Please enter username!");
document.test.username.focus();
return false;
}
if(document.test.password.value.length <= 0) {
alert("Please enter password");
document.test.password.focus();
return false;
}
return true;
}
function frmLoad() {
document.test.username.focus();
}
</script>
</head>
<body onload=frmLoad() id="login_body">
<form action="login.cgi" method=POST name="test" autocomplete="off" >
<div class="loginBox">
<div class="login_left_bg"></div>
<div class="loginCtr">
<h2><font color="#FFFFFF">USER LOGIN</font></h2>
<table>
<tr>
<td>User Name:</td>
<td><input type="text"
id="username" name="username"/></td>
</tr>
<tr>
<td>Password:</td>
<td><input name="password"
id="password" type="password"/></td>
</tr>
</table>
<div class="login_btn">
<input id="loginBtn" onclick="return onlogin()" type="submit" value="Login" class="link_bg">
<input id="rewBtn" type="reset" value="Reset" class="link_bg" autocomplete="off" >
<input type="hidden" name="submit.htm?login.htm" value="Send">
</div>
</div>
<div class="login_right_bg"></div>
</div>
</form>
</body>
</html>
		<html>
<head>
<title>Router</title>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<link rel="stylesheet" href="reset.css">
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="style.css">
<script language=javascript>
function onlogin() {
if(document.test.username.value.length <= 0) {
alert("Please enter username!");
document.test.username.focus();
return false;
}
if(document.test.password.value.length <= 0) {
alert("Please enter password");
document.test.password.focus();
return false;
}
return true;
}
function frmLoad() {
document.test.username.focus();
}
</script>
</head>
<body onload=frmLoad() id="login_body">
<form action="login.cgi" method=POST name="test" autocomplete="off" >
<div class="loginBox">
<div class="login_left_bg"></div>
<div class="loginCtr">
<h2><font color="#FFFFFF">USER LOGIN</font></h2>
<table>
<tr>
<td>User Name:</td>
<td><input type="text"
id="username" name="username"/></td>
</tr>
<tr>
<td>Password:</td>
<td><input name="password"
id="password" type="password"/></td>
</tr>
</table>
<div class="login_btn">
<input id="loginBtn" onclick="return onlogin()" type="submit" value="Login" class="link_bg">
<input id="rewBtn" type="reset" value="Reset" class="link_bg" autocomplete="off" >
<input type="hidden" name="submit.htm?login.htm" value="Send">
</div>
</div>
<div class="login_right_bg"></div>
</div>
</form>
</body>
</html>
Справа от User Name: есть поле для логина
Справа от Password: есть поле для пароля
И подтвердить нажатием на Login. Нажатие на Login можно заменить на
			
				Код:
			
		
		
		ControlSend ( $Tit, "", "Internet Explorer_Server1", "{ENTER}" )
	но хочется примера правильного нажатия.
			
				Код:
			
		
		
		<!DOCTYPE HTML><html><head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Refresh" content="300;url=http://192.168.1.1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="reset.css" rel="stylesheet" type="text/css" />
<link href="base.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="share.js" type="text/javascript" >
</script >
 <title>ADSL Router Status</title>
    <script>
var isWizardProcess = 0;
        function modifyClick(url)
        {
            var wide = 600;
            var high = 400;
            if (document.all)
                var xMax = screen.width, yMax = screen.height;
            else if (document.layers)
                var xMax = window.outerWidth, yMax = window.outerHeight;
            else
                var xMax = 640, yMax = 480;
            var xOffset = (xMax - wide) / 2;
            var yOffset = (yMax - high) / 3;
            var settings = 'width=' + wide + ',height=' + high + ',screenX=' + xOffset + ',screenY=' + yOffset + ',top=' + yOffset + ',left=' + xOffset + ', resizable=yes, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes';
            window.open(url, 'Status_Modify', settings);
        }
        function submitPPPoe(form, pppoenum, connect)
        {
            form.pppoenum.value = pppoenum;
            form.connect.value = connect;
            form.submit();
        }
 function onload()
 {
  if(isWizardProcess== 1)
   top.document.location.reload();
 }
    </script>
</head>
<body id="device_info" onload="onload();">
    <div class="intro_main ">
        <p class="intro_title">ADSL Router Status</p>
        <p class="intro_content">This page shows the current status and some basic settings of the device.</p>
    </div>
    <div class="column">
        <div class="column_title">
            <div class="column_title_left"></div>
            <p>System</p>
            <div class="column_title_right"></div>
        </div>
        <div class="data_common">
            <table>
                <tr style="
display: table-row;
  ">
                    <th width="30%">Alias Name</th>
                    <td>
ADSL Modem
                    </td>
                </tr>
                <tr>
                    <th>Uptime</th>
                    <td>
0 14:56:19
                    </td>
                </tr>
                <tr>
                    <th>Date/Time</th>
                    <td>
Sun Jan  1 17:56:19 2012
                    </td>
                </tr>
                <tr>
                    <th>Firmware Version</th>
                    <td>
 V3.1.1
                    </td>
                </tr>
                <tr>
                    <th>Built Date</th>
                    <td>
Feb 24 2017 15:00:32
                    </td>
                </tr>
                <tr>
                    <th>Serial Number</th>
                    <td>
3HTF7YJYJ7
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="column">
        <div class="column_title">
            <div class="column_title_left"></div>
            <p>DSL</p>
            <div class="column_title_right"></div>
        </div>
        <div class="data_common">
            <table>
                <tr>
                    <th width="30%">Operational Status</th>
                    <td>
T1.413
                    </td>
                </tr>
                <tr>
                    <th>Upstream Speed</th>
                    <td>
672 kbps
                    </td>
                </tr>
                <tr>
                    <th>Downstream Speed</th>
                    <td>
16000 kbps
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="column">
        <div class="column_title">
            <div class="column_title_left"></div>
            <p>CWMP Status</p>
            <div class="column_title_right"></div>
        </div>
        <div class="data_common">
            <table>
                <tr>
                    <th width="30%">Inform Status</th>
                    <td>
No Inform Send(No ACS Setting)
                   </td>
                </tr>
                <tr>
                    <th>Connecion Request Status</th>
                    <td>
No connection request
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="column">
        <div class="column_title">
            <div class="column_title_left"></div>
            <p>LAN Configuration</p>
            <div class="column_title_right"></div>
        </div>
        <div class="data_common">
            <table>
                <tr>
                    <th width="30%">IP Address</th>
                    <td>
192.168.1.1
                    </td>
                </tr>
                <tr>
                    <th>Subnet Mask</th>
                    <td>
255.255.255.0
                    </td>
                </tr>
                <tr>
                    <th>IPV6 Address</th>
                    <td>
dh80::d456:36gg:dhgh:4kg7
                    </td>
                </tr>
                <tr>
                    <th>DHCP Server</th>
                    <td>
Enable
                    </td>
                </tr>
                <tr>
                    <th>MAC Address</th>
                    <td>
E7:47:36:JJ:6P:S0
                   </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="column">
        <div class="column_title">
            <div class="column_title_left"></div>
            <p>DNS Status</p>
            <div class="column_title_right"></div>
        </div>
        <div class="data_common">
            <table>
                <tr>
                    <th width="30%">DNS Mode</th>
                    <td>
Auto
                    </td>
                </tr>
                <tr>
                    <th>DNS Servers</th>
                    <td>
143.68.079.756
79.356.48.89
                    </td>
                </tr>
                <tr>
                    <th>IPv6 DNS Mode</th>
                    <td>
Auto
                    </td>
                </tr>
                <tr>
                    <th>IPv6 DNS Servers</th>
                    <td>
 
   </td>
                </tr>
            </table>
        </div>
    </div>
    <form action="form2WebRefresh.cgi" method=POST name="status">
    <INPUT TYPE="HIDDEN" NAME="pppoenum" VALUE="" >
    <INPUT TYPE="HIDDEN" NAME="connect" VALUE="" >
    <div class="column">
        <div class="column_title">
            <div class="column_title_left"></div>
            <p>ADSL WAN Interfaces</p>
            <div class="column_title_right"></div>
        </div>
        <div class="data_common data_vertical">
            <table>
                <tr>
                    <th>Interface</th>
                    <th>VPI/VCI</th>
                    <th>Encap</th>
                    <th>Droute</th>
                    <th>Protocol</th>
                    <th>IP Address</th>
                    <th>Gateway</th>
                    <th>Status</th>
                </tr>
                <tr>
<TR>
<TD align=center bgcolor="#C0C0C0">pppoe1</TD>
<TD align=center bgcolor="#C0C0C0">0/33</TD>
<TD align=center bgcolor="#C0C0C0">LLC</TD>
<TD align=center bgcolor="#C0C0C0">Off</TD>
<TD align=center bgcolor="#C0C0C0">PPPoE</TD>
<TD align=center bgcolor="#C0C0C0">178.207.225.99</TD>
<TD align=center bgcolor="#C0C0C0">10.8.255.134</TD>
<TD align=center bgcolor="#C0C0C0">up 0 3:4:24 
 /0 14:21:0 
 <input type="button" name="connect_chg" value="disconnect" onClick = "submitPPPoe(this.form,'1','disconnect');"> </TD>
</TR>
</TABLE>
                </tr>
            </table>
        </div>
    </div>
 <div class="column">
        <div class="column_title">
            <div class="column_title_left"></div>
            <p>ADSL WAN IPV6 Configuration</p>
            <div class="column_title_right"></div>
        </div>
        <div class="data_common data_vertical">
            <table>
                <tr>
                    <th>Interface</th>
                    <th>VPI/VCI</th>
                    <th>Encap</th>
                    <th>Protocol</th>
                    <th>IPv6 Address</th>
   <th>Prefix</th>
                    <th>Gateway</th>
                    <th>Droute</th>
                    <th>Status</th>
                </tr>
                <tr>
<TR>
<TD align=center bgcolor="#C0C0C0">pppoe1</TD>
<TD align=center bgcolor="#C0C0C0">0/33</TD>
<TD align=center bgcolor="#C0C0C0">LLC</TD>
<TD align=center bgcolor="#C0C0C0">PPPoE</TD>
<TD align=center bgcolor="#C0C0C0"> </TD>
<TD align=center bgcolor="#C0C0C0"> </TD>
<TD align=center bgcolor="#C0C0C0"> </TD>
<TD align=center bgcolor="#C0C0C0"> </TD>
<TD align=center bgcolor="#C0C0C0">down</TD>
</TR>
</TABLE>
                </tr>
            </table>
        </div>
    </div>
     <div class="column">
        <div class="column_title">
            <div class="column_title_left"></div>
            <p>Ethernet WAN Interfaces</p>
            <div class="column_title_right"></div>
        </div>
        <div class="data_common data_vertical">
            <table>
                <tr>
                    <th>Interface</th>
                    <th>Droute</th>
                    <th>Protocol</th>
                    <th>IP Address</th>
                    <th>Gateway</th>
                    <th>Status</th>
                </tr>
                <tr>
                </tr>
            </table>
        </div>
    </div>
 <div class="column">
        <div class="column_title">
            <div class="column_title_left"></div>
            <p>Ethernet WAN IPV6 Configuration</p>
            <div class="column_title_right"></div>
        </div>
        <div class="data_common data_vertical">
            <table>
                <tr>
                    <th>Interface</th>
                    <th>Protocol</th>
                    <th>IPv6 Address</th>
                    <th>Prefix</th>
                    <th>Gateway</th>
                    <th>Droute</th>
                    <th>Status</th>
                </tr>
                <tr>
                </tr>
            </table>
        </div>
    </div>
    <div class="btn_ctl">
        <input class="link_bg" type="submit" name="refresh" value="Refresh">
        <input type="hidden" name="submit.htm?status.htm" value="Send">
    </div>
    </form>
</body>
</html>
	
			
				Код:
			
		
		
		 <input type="button" name="connect_chg" value="disconnect" onClick = "submitPPPoe(this.form,'1','disconnect');"> </TD>