📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 0 'None
Caption = "Form3"
ClientHeight = 4425
ClientLeft = 0
ClientTop = 0
ClientWidth = 7290
LinkTopic = "Form3"
Picture = "frmLogin.frx":0000
ScaleHeight = 4425
ScaleWidth = 7290
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 3000
Left = 120
Top = 1440
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "请稍后...."
BeginProperty Font
Name = "华文行楷"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2520
TabIndex = 1
Top = 1680
Width = 2295
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "系统正在初始化"
BeginProperty Font
Name = "华文行楷"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1800
TabIndex = 0
Top = 1080
Width = 3135
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Dim SmsRate As String
Dim SmsPort As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set A = fs.OpenTextFile(App.Path & "\setting.txt", 1)
SmsRate = Trim(A.readline)
SmsPort = Trim(A.readline)
Form1.MSComm1.Settings = SmsRate
Form1.MSComm1.CommPort = CInt(SmsPort)
Form1.MSComm1.InputLen = 0 '读入整个缓冲区
Form1.MSComm1.PortOpen = True '打开端口
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim start As Single
Dim Success As String
Timer1.Enabled = False
Form1.MSComm1.Output = "AT" + vbCr
start = Timer
Do While Timer < start + 0.5
DoEvents
Loop
If Form1.MSComm1.InBufferCount Then
Success = Form1.MSComm1.Input
End If
If InStr(Success, "OK") > 0 Then
frmCustom.Show
Unload Me
Else
MsgBox "初始化失败,点击确定后,程序将自动退出"
End
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -