端口测试.frm

来自「用vb开发的端口的测试」· FRM 代码 · 共 52 行

FRM
52
字号
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4830
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8700
   LinkTopic       =   "Form1"
   ScaleHeight     =   4830
   ScaleWidth      =   8700
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   855
      Left            =   1680
      TabIndex        =   0
      Top             =   600
      Width           =   1575
   End
   Begin MSCommLib.MSComm MSComm1 
      Left            =   240
      Top             =   720
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public WithEvents MSComm1 As clsMSComm
Attribute MSComm1.VB_VarHelpID = -1
Private Sub Command1_Click()
Dim i As Integer
Dim arr() As String
arr() = MSComm1.CommPortFix
For i = 0 To UBound(arr)
Print "可用端口", arr(i)
Next i
End Sub

Private Sub Form_Load()
Set MSComm1 = New clsMSComm
MSComm1.MSCommCreat Me, "BadName"
End Sub

⌨️ 快捷键说明

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