📄 frmdosoutput.frm
字号:
VERSION 5.00
Begin VB.Form frmDOSOutput
BackColor = &H00000000&
Caption = "Net Test"
ClientHeight = 6480
ClientLeft = 2355
ClientTop = 1515
ClientWidth = 7395
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 6480
ScaleWidth = 7395
Begin VB.ListBox List1
Height = 1680
ItemData = "frmDOSOutput.frx":0000
Left = 120
List = "frmDOSOutput.frx":0013
TabIndex = 4
Top = 360
Width = 7095
End
Begin VB.TextBox txtCommand
Height = 285
Left = 120
TabIndex = 3
Top = 2280
Width = 7095
End
Begin VB.CommandButton cmdExit
Caption = "Exit"
Height = 375
Left = 5280
TabIndex = 2
Top = 5880
Width = 1875
End
Begin VB.TextBox txtOutputs
BeginProperty Font
Name = "Courier New"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 3135
Left = 120
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 2640
Width = 7155
End
Begin VB.CommandButton cmdExecute
Caption = "Execute"
Default = -1 'True
Height = 375
Left = 3240
TabIndex = 0
Top = 5880
Width = 1875
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00FFFFFF&
Caption = "Commands:"
Height = 195
Left = 120
TabIndex = 5
Top = 120
Width = 825
End
End
Attribute VB_Name = "frmDOSOutput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'DOSOutpus
'Capture the outputs of a DOS command
'Author: Marco Pipino
'marcopipino@libero.it
'28/02/2002
Option Explicit
Private WithEvents objDOS As DOSOutputs
Attribute objDOS.VB_VarHelpID = -1
Private Sub cmdExecute_Click()
txtOutputs.Text = txtCommand.Text + vbCrLf
On Error GoTo errore
objDOS.CommandLine = txtCommand.Text
objDOS.ExecuteCommand
Exit Sub
errore:
MsgBox (err.Description & " - " & err.Source & " - " & CStr(err.Number))
End Sub
Private Sub cmdExit_Click()
Set objDOS = Nothing
Unload Me
End Sub
Private Sub Form_Load()
Set objDOS = New DOSOutputs
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set objDOS = Nothing
End Sub
Private Sub List1_Click()
txtCommand.Text = List1.List(List1.ListIndex)
End Sub
Private Sub objDOS_ReceiveOutputs(CommandOutputs As String)
txtOutputs.Text = txtOutputs.Text & CommandOutputs
End Sub
Private Sub txtOutputs_Change()
txtOutputs.SelStart = Len(txtOutputs.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -