WebBrowser Auto Click Link AD automatically click ads Auto Click

Source: Internet
Author: User

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

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.