如何自动登录到我的路由器? [英] How to login automatically to my router ?

查看:316
本文介绍了如何自动登录到我的路由器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

当我将Tcpclient classe连接到路由器192.168.1.1时,他问我有关密码的问题,请参见 [^ ],使用的代码是:

Hi friends,

When i''m connecting (with Tcpclient classe) to my router 192.168.1.1 he ask me about Password,See here [^]and the code used is :

TcpClient tcpclient = new TcpClient();
            try
            {
                tcpclient.Connect("192.168.1.1", 23);
                NetworkStream ns = tcpclient.GetStream();
 

                byte[] inStream = new byte[10025];
                ns.Read(inStream, 0, (int)tcpclient.ReceiveBufferSize);
                string returndata = System.Text.Encoding.ASCII.GetString(inStream);
                Console.WriteLine("Data from Server : " + returndata);
                //string password = "admin";
                
 
                
                byte[] msg = Encoding.ASCII.GetBytes("admin");
                ns.Write(msg, 0, msg.Length);
                ns.Flush();
 
                
            }
            catch
            {
                
            }



我想在这里使用密码"admin"自动在代码中登录路由器
我该怎么办?

谢谢您.



and i want here to login to my router with my password "admin" automatically in the code
how can i do it ?

Thank you

推荐答案

您的请参见此处[^] 链接无效,但我认为您已获取网络表单,需要填写输入密码,然后将其发布回路由器.您需要创建一个响应,就像单击提交"按钮时浏览器中的网页一样.您可以使用HttpWebResponse类创建它.请查看示例链接和更多信息.

http://www.dijksterhuis.org/simple-class -to-submit-post-a-web-form-from-csharp/ [ http://stackoverflow.com/questions/793755/how-to-fill-forms-and-submit-with-webclient-in-c [
Your see here[^] link isn''t working but I assume you get a web form and need to fill in the password and post it back to the router. You need to create a response like a webpage in the browser would do when you click the submit button. You can create it using the HttpWebResponse class. Have a look at the links for an example and more info.

http://www.dijksterhuis.org/simple-class-to-submit-post-a-web-form-from-csharp/[^]

http://stackoverflow.com/questions/793755/how-to-fill-forms-and-submit-with-webclient-in-c[^]

Good luck!


您可以看到这个老师:

http://www.albahari.com/nutshell/ch14.aspx [
You can see this tutoriel :

http://www.albahari.com/nutshell/ch14.aspx[^]

good like carlos,


这篇关于如何自动登录到我的路由器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆