Pay-per-click advertising is currently a popular network marketing model, but, if you simply rely on a manual one to point, always feel that it is not cost-effective, can realize automatic to click it? The answer is yes.
The WebBrowser in. NET can meet our requirements
If you use the idea of this article to do money, the consequences are at your own risk (
however, at present, this kind of thing has not been done, the pay websites have taken the response, hehe, the magic feet, the road, the realization is still feasible, concrete on the people to play the)
Here are some of the core code, all the code, please download the source of the project included in this article
Private voidWebbrowser1_documentcompleted (Objectsender, WebBrowserDocumentCompletedEventArgs e) {//If you need to log in, call the process of automatic login //this. AutoLogon ("account number", "password"); //Get all link on the target page, then analyze these link to find theHtmlElementCollection links = This. webBrowser1.Document.Links;foreach(HtmlElement linkinchLinks) {//I use Google links here to do an exampleif(Link. GetAttribute ("href"). Contains ("google.com")) {link. InvokeMember ("Click");//trigger a linked click event} }}// <summary> /// automatic login for cases with no verification code // </summary> // <param name= "userId" > Login's account number </param> // <param name= "password" > password for login </param> Private voidAutoLogon (stringUseridstringPassword) {#region Gets the input box and the Submit button of the login form htmlelement Textboxuserid = This. WebBrowser1.Document.GetElementById ("ID of the login user name text box");//If there is no ID, use Name to get //htmlelement Textboxuserid = this.webbrowser1.document.all["Login user name text box name"];HtmlElement Textboxpassword = This. WebBrowser1.Document.GetElementById ("ID of the login password box");//If there is no ID, use name to get //htmlelement Textboxpassword = this.webbrowser1.document.all["Login Password box name"];HtmlElement Buttonsubmit = This. WebBrowser1.Document.GetElementById ("ID of the login button");//If there is no ID, use name to get //htmlelement buttonsubmit = this.webbrowser1.document.all["login button name"];Textboxuserid.setattribute ("value", userId);//Fill in the accountTextboxpassword.setattribute ("value", password);//Fill in the passwordButtonsubmit.invokemember ("Click");//Trigger Click event for Submit button //Of course, login, can also be used //this.webbrowser1.document.forms[0]. InvokeMember ("submit"); //To implement, however, the above statement skips the browser client validation function (if any)#endregion//Log in, you need to determine whether the login is successful, according to the URL after login //or this.webBrowser1.Document.Body.InnerHtml content to judge}
Full source Download