C#开发暴力破解网页密码程序(启发)

最近无聊学了一下用C#开发破解程序,所以专门研究了一下.相信很多人一开始都对怎么捉取网页中密码框并填写感到迷惑,而不知道怎么解决吧,下面就有我来解释一下吧!

C# WebBrowser自动登录和点击:

 

        private void wb_page_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {

                    //tbYHM为用户名,tbPSW为密码
                    wb_page.document.getElementById_x("tbYHM").SetAttribute("value", "用户名");
                    wb_page.document.getElementById_x("tbPSW").SetAttribute("value", "密码");
                    HtmlElement ClickBtn = wb_page.document.getElementById_x("imgDL");
                    ClickBtn.InvokeMember("Click");//对网页按钮自动点击鼠标左键 
        }    

 

如果想要学搞破解的话,只要在上面的基础上加上遍历运算就可以了,具体就不教了咯,呵呵,违法D!

顺便提一下,在你登录不成功时,那些网页都会不厌其烦的弹出对话框,真的烦死了,教你们怎么屏蔽掉它!

       

        //wb_page为WebBrowser的实例

        private void wb_page_Navigated(object sender, WebBrowserNavigatedEventArgs e)
        {
            IHTMLWindow2 win = (IHTMLWindow2)wb_page.Document.Window.DomWindow;
            string s = @"function confirm() {";
            s += @"return true;";
            s += @"}";
            s += @"function alert(){}";
            win.execScript(s, "javascript");
            wb_page.ObjectForScripting = this;
        }

你可能感兴趣的:(C#.Winform)