SanCi

重启路由器脚本
重启TP-Link路由器脚本,保存为 .hta文件<html> <head> <...
扫描右侧二维码阅读全文
03
2013/01

重启路由器脚本

重启TP-Link路由器脚本,保存为 .hta文件

<html> 
<head> 
<title>login</title> 
<script> 
var xmlHttp;
function createXMLHttpRequest() { 
if (window.ActiveXObject) { 
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
} 
else if (window.XMLHttpRequest) { 
xmlHttp = new XMLHttpRequest(); 
} 
}
function login() { 
createXMLHttpRequest();
var username = document.getElementById("username").value; 
var password = document.getElementById("password").value;
xmlHttp.open("GET", "http://192.168.0.1/userRpm/SysRebootRpm.htm?Reboot=%D6%D8%C6%F4%C2%B7%D3%C9%C6%F7", false, username, password); 
//xmlHttp.setRequestHeader("Content-Type","..."); 
xmlHttp.send(null);
if(xmlHttp.status!=200) 
alert(xmlHttp.status); 
else 
alert("已经为您重启了路由器");
return xmlHttp.status == 200; 
} 
</script> 
</head> 
<body> 
<form action="#" method="post" onsubmit="return login();"> 
<fieldset> 
<legend>登陆窗</legend> 
<label for="username">用户名:</label> 
<input type="text" id="username" name="username" value="admin">
<label for="password">密码:</label> 
<input type="password" id="password" name="password" value="">
<input type="submit" value="重启路由器"> 
</fieldset> 
</form> 
</body> 
</html>

随机一言(显示内容与本文关)
Last modification:May 3rd, 2018 at 11:50 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment