C # implement automatic router disconnection and IP address replacement

Source: Internet
Author: User

C # implement automatic router disconnection and IP address replacement
Currently, the routers we use are all managed on the WEB interface, and there are very few routers that actually support TELNET (port 23. for this. we can use socket to operate port 80 of the router. send a command to the router to disconnect the router. at the same time, set the router to automatic connection. the automatic IP address replacement function can be implemented. vro login authentication adopts BASE64 encrypted Login Name: Password format. for example, admin: the password string obtained by admin is YWRtaW46YWRtaW4 = Convert can be easily implemented in c. toBase64String (Encoding. default. getBytes ("admin: admin") we use the http get Operation GET/userRpm/StatusRpm.htm? Disconnect = % B6 % CF + % CF % DF & wan = 1 HTTP/1.1 Host: 192.168.1.1Authorization: basic YWRtaW46YWRtaW4 = can be used to call the router disconnection operation. Can you also use GET/userRpm/SysRebootRpm.htm? Reboot = % D6 % D8 % C6 % F4 % C2 % B7 % D3 % C9 % C6 % F7 HTTP/1.1 Host: 192.168.1.1Authorization: basic YWRtaW46YWRtaW4 = is used to restart the vro. The above addresses are in TPLINK WR740N and TPLINK R402M. The obtained code snippets can be obtained through the MX3 network monitoring function of vrouters of other brands: <FORM action = "StatusRpm.htm" enctype = "multipart/form-data" method = "get"> use the GET method <SCRIPT language = "JavaScript"> var wlan_wds = 1; var wlan_rate = 0; <! -- Function doRefresh () {location. href = "/userRpm/StatusRpm.htm"; return true;} function doConnect (n) {var s = "& wan =" + n; location. href = "/userRpm/StatusRpm.htm? Connect = Connect "+ s; return true;} function doDisConnect (n) {var s =" & wan = "+ n; location. href ="/userRpm/StatusRpm.htm? Disconnect = disconnected "+ s; return true;} the disconnected call is"/userRpm/StatusRpm.htm? Disconnect = disconnected "do not use this program to perform operations in violation of Internet regulations. For more information, see c # application.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.