?? form1.frm
字號:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form form1
Caption = "獲取計(jì)算機(jī)上串口的數(shù)量"
ClientHeight = 2715
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 2715
ScaleWidth = 4680
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command2
Caption = "退出"
Height = 555
Left = 2340
TabIndex = 2
Top = 1590
Width = 1275
End
Begin VB.CommandButton Command1
Caption = "獲取"
Height = 555
Left = 1050
TabIndex = 0
Top = 1590
Width = 1275
End
Begin MSCommLib.MSComm MSComm1
Left = 105
Top = 930
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin VB.Label Label1
Height = 675
Left = 960
TabIndex = 1
Top = 660
Width = 2925
End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i, j As Integer
Private Sub Command1_Click()
j = 0
For i = 1 To 16
MSComm1.CommPort = i
On Error Resume Next
MSComm1.PortOpen = True
If Err.Number = 0 Then
j = j + 1
Else
MSComm1.PortOpen = False
End If
Next i
Label1.Caption = "您計(jì)算機(jī)上的串口數(shù): " & j & "個(gè)"
End Sub
Private Sub Command2_Click()
End
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -