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();
            }
    
    
        }
    }
    活着就得为精彩,每一个瞬间都可能死去!
  • 相关阅读:
    python之路——第三块(面向对象)
    python-第二块:random、shutil,json & pickle,shelve模块
    Win10和Linux系统下安装Mysql 8.0+版本
    django-(CSRF跨站请求伪造XSS、Cookie、Session、缓存、序列化、信号)
    django-(创建工程项目的基本配置、url路由系统详解、中间件&请求生命周期、admin介绍、FBV和CBV装饰器实现用户登陆认证)
    七、Web框架基础
    六、jQuery基础
    四、Dom基础
    二、css基础
    缓存和非关系型数据库的相关知识(memcached、redis)网址连接
  • 原文地址:https://www.cnblogs.com/rapperx2/p/5727340.html
Copyright © 2011-2022 走看看