zoukankan      html  css  js  c++  java
  • 狗扑论坛 自动刷取VIP狗粮

    狗扑论坛 自动刷取VIP狗粮

    开始闲狗粮回复太慢就自己想了想去写一个,成功总是给我的哈哈。

    自己花了一小时 时间慢慢学就慢慢写的  虽然代码简单 但是已经够自己用了

    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:创建WebRequest对象  
                webBrowser1.Document.Encoding = "UTF-8"; //解决网页乱码
    
    
                //HttpWebResponse对象实例:该类用于获取和操作HTTP应答 var可改成HttpWebResponse  
                var response = (HttpWebResponse)request.GetResponse(); //GetResponse:获取答复  
    
                //构造数据流对象实例  
                Stream stream = response.GetResponseStream();//GetResponseStream:获取应答流  
                StreamReader sr = new StreamReader(stream);  //从字节流中读取字符  
    
                
                //从流当前位置读取到末尾并显示在WebBrower控件中  
                string content = sr.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", "用户名");
                pass.SetAttribute("value","密码");
                MessageBox.Show(user.ToString());
                but.InvokeMember("Click");
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                HtmlElement text = webBrowser1.Document.All["message"];
                text.SetAttribute("value","+10袋狗粮");
    
                HtmlElement but = webBrowser1.Document.GetElementById("postsubmit");
                but.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袋狗粮");
    
                    HtmlElement but1 = webBrowser1.Document.All["replysubmit"];
                    but1.InvokeMember("Click");
    
                    timer1.Stop();
            }
    
    
        }
    }
    活着就得为精彩,每一个瞬间都可能死去!
  • 相关阅读:
    Cdnbest的cdn程序默认支持web Socket
    在winsshd 中添加id_rsa.pub 实现Windows 服务器主机自动信任Linux 客户端
    Excel 如何排序与多关键字排序
    JZOJ 6316. djq的朋友圈(状压DP)
    JZOJ 6309. 完全背包(矩阵max)
    JZOJ 6307. 安排(归并排序+分治)
    JZOJ 6299. 2019.08.12【NOIP提高组A】工厂(二分图+状压DP)
    JZOJ 6276. 【noip提高组模拟1】树(DFS序+扫描线)
    JZOJ 6278. 2019.8.5【NOIP提高组A】跳房子 (分块模拟)
    JZOJ 6278. 2019.8.5【NOIP提高组A】跳房子 (分块模拟)
  • 原文地址:https://www.cnblogs.com/rapperx2/p/5727340.html
Copyright © 2011-2022 走看看