• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

cynchanpin

  • 博客园
  • 联系
  • 订阅
  • 管理

View Post

C#-訪问轰炸机,新建进程,结束进程...(ConsoleApp)---ShinePans

这个程序能够自己主动打开要打开的网址,而且自己主动结束进程,这样能够达到博文点击流量的添加

program.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace Tst
{
    class Program
    {
        static void Main(string[] args)
        {
            for(int i=0;i<1000;i++)
            {
                Console.WriteLine("添加{0}次了!", i);
                Util util = new Util();
                util.StartThrad();
                Thread.Sleep(5000);   //设置速度
                util.Close();
            }
        }
    }
}

Util.cs

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;

namespace Tst
{
  public  class Util
    {
      public void StartThrad()
      {
          ThreadStart start = new ThreadStart(StartIE);
          Thread thread = new Thread(start);
          thread.Start();
      }

      public void Close()
      {
          Process[] pro = Process.GetProcesses(); //获取全部的进程
          //遍历进程
          for(int i=0;i<pro.Length;i++)
          {
              //推断是否为要查找的进程
              if (pro[i].ProcessName.ToString().ToLower() == "360chrome")  //本人測试的是 360极速浏览器 ,其它的浏览器请改进程名
                  pro[i].Kill(); //结束进程;
          }
      }

      private void StartIE()
      {
          Process.Start("http://user.qzone.qq.com/574273250");  //待訪问的地址 ,站点的计算规则自己查询,有不同的计算方式,时间间隔,Id号等
      }
  
    }
}



posted on 2017-05-14 12:47  cynchanpin  阅读(662)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3