Automatically collect VIP dog food and vip from a dog flutter Forum
Automatically collect VIP dog food from a dog flutter Forum
At the beginning, when I started to reply slowly, I thought about writing a program. Success is always for me.
I spent an hour learning it and wrote it slowly. Although the code is simple, it is enough for my own use.
Using System; using System. collections. generic; using System. componentModel; using System. data; using System. drawing; using System. linq; using System. text; using System. windows. forms; using System. net; using System. IO; namespace WindowsFormsApplication1 {public partial class Form1: Form {public Form1 () {InitializeComponent ();} private void Form1_Load (object sender, EventArgs e) {var request = (HttpWebRequest) webRequest. create (" http://bbs.goupu.org/member.php?mod=logging&action=login "); // Create: Create the WebRequest object webBrowser1.Document. encoding = "UTF-8"; // address web page garbled // HttpWebResponse object instance: this class is used to get and operate HTTP response var can be changed to HttpWebResponse var response = (HttpWebResponse) request. getResponse (); // GetResponse: Get a response // construct a data Stream object instance stream = response. getResponseStream (); // GetResponseStream: Get the response stream StreamReader sr = new StreamReader (stream ); // read characters from the byte stream // read from the current position of the stream to the end and display string content = sr in the WebBrower control. readToEnd (); webBrowser1.DocumentText = content; HtmlElement user = webBrowser1.Document. all ["username"]; HtmlElement pass = webBrowser1.Document. all ["password"]; HtmlElement but = webBrowser1.Document. all ["loginsubmit"]; if (user = null | pass = null | but = null) {return;} user. setAttribute ("value", "User Name"); pass. setAttribute ("value", "password"); MessageBox. show (user. toString ();. invokeMember ("Click");} private void button1_Click (object sender, EventArgs e) {HtmlElement text = webBrowser1.Document. all ["message"]; text. setAttribute ("value", "+ 10 bags of dog food"); HtmlElement but = webBrowser1.Document. getElementById ("postsubmit");. invokeMember ("Click");} private void button2_Click (object sender, EventArgs e) {timer1.Enabled = true; timer1.Interval = 1000; timer1.Start (); HtmlElement img = webBrowser1.Document. getElementById ("fastpostmessage"); img. setAttribute ("value", "+ 10 bags of dog food"); HtmlElement but1 = webBrowser1.Document. all ["replysubmit"]; but1.InvokeMember ("Click"); timer1.Stop ();}}}