首 页文章中心黑客软件黑客动画绿色软件私服技术私服下载本站论坛
您当前的位置:黑客之 家文章中心黑客编程VB 编程 → 文章内容 退出登录 用户管理
本类热门文章
相关文章
站内广告
VB编写多线程扫描器
作者:本站  来源:www.hackjia.com  发布时间:2007-12-19 11:24:52

减小字体 增大字体

Dim Socket As Variant
Dim CurrentPort As Integer
Const MaxSockets = 200
On Error Resume Next
If Command1.Caption = "开始" Then
Command1.Caption = "停止"
  For i = 1 To MaxSockets
  Load Sock(i)
  Next i
  CurrentPort = txtPortStart.Text
  While Command1.Caption = "停止"
    For Each Socket In Sock
        DoEvents
        If Socket.State <> sckClosed Then
          GoTo continue
        End If
          Socket.Close
        If CurrentPort = Val(txtPortEnd.Text) + 1 _
        Then Exit For
        Socket.RemoteHost = txtHost.Text
        Socket.RemotePort = CurrentPort
        Text1.Text = "正在扫描IP " & txtHost & " 的端口 当前端口 " & CurrentPort
        Socket.Connect
        CurrentPort = CurrentPort + 1
continue:
    Next Socket
    Wend
Command1.Caption = "开始"
    txtHost.Enabled = True
    txtPortStart.Enabled = True
    txtPortEnd.Enabled = True
Else
  Command1.Caption = "开始"
End If
For i = 1 To MaxSockets
  Unload Sock(i)
Next i
Private Sub FoundPorts_Change()
FoundPorts.SelStart = Len(FoundPorts.Text)
End Sub
Private Function AddPort(port As Integer)   
FoundPorts.Text = FoundPorts.Text & txtHost & " → " & port & " 端口开放" & vbCrLf
End Function
Private Sub Sock_Connect(Index As Integer)
AddPort (Sock(Index).RemotePort)
Sock(Index).Close
End Sub
[] [返回上一页] [打 印]
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 文章投稿 - 软件发布 - 购物资讯网 - _