📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
Caption = "登录"
ClientHeight = 3555
ClientLeft = 60
ClientTop = 345
ClientWidth = 3960
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3555
ScaleWidth = 3960
StartUpPosition = 3 '窗口缺省
Begin VB.OptionButton optnGuest
Caption = "未注册用户登录"
Height = 255
Left = 1920
TabIndex = 3
Top = 1080
Width = 1695
End
Begin VB.OptionButton optnUser
Caption = "用户登录"
Height = 255
Left = 480
TabIndex = 2
Top = 1080
Value = -1 'True
Width = 1335
End
Begin VB.Frame Frame1
Height = 1215
Left = 240
TabIndex = 9
Top = 1560
Width = 3375
Begin VB.TextBox txtName
Height = 270
Left = 960
MaxLength = 20
TabIndex = 5
Top = 360
Width = 2175
End
Begin VB.TextBox txtPwd
Height = 270
IMEMode = 3 'DISABLE
Left = 960
MaxLength = 20
PasswordChar = "*"
TabIndex = 6
Top = 720
Width = 2175
End
Begin VB.Label Label4
Caption = "用户名:"
Height = 255
Left = 120
TabIndex = 11
Top = 360
Width = 735
End
Begin VB.Label Label5
Caption = "密码:"
Height = 255
Left = 120
TabIndex = 10
Top = 720
Width = 615
End
End
Begin VB.CommandButton cmdLogin
Caption = "登录到服务器上……"
Default = -1 'True
Height = 375
Left = 240
TabIndex = 7
Top = 3000
Width = 3375
End
Begin VB.TextBox txtHost
Height = 270
Left = 1320
MaxLength = 50
TabIndex = 0
Top = 240
Width = 2295
End
Begin VB.TextBox txtPort
Height = 270
Left = 1320
MaxLength = 6
TabIndex = 1
Top = 600
Width = 735
End
Begin VB.Label Label2
Caption = "服务器地址:"
Height = 255
Left = 240
TabIndex = 8
Top = 240
Width = 1215
End
Begin VB.Label Label3
Caption = "端口号:"
Height = 240
Left = 240
TabIndex = 4
Top = 600
Width = 855
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdLogin_Click()
If txtHost.Text = "" Then
MsgBox "请填写服务器地址!", vbInformation, "登录"
txtHost.SetFocus
Exit Sub
ElseIf txtPort.Text = "" Or Not IsNumeric(txtPort.Text) Then
MsgBox "请正确填写端口号!", vbInformation, "登录"
txtPort.SetFocus
Exit Sub
ElseIf txtName.Text = "" And optnUser.Value Then
MsgBox "请填写用户名!", vbInformation, "注册"
txtName.SetFocus
Exit Sub
ElseIf txtPwd.Text = "" And optnUser.Value Then
MsgBox "请填写密码!", vbInformation, "注册"
txtPwd.SetFocus
Exit Sub
End If
'收集信息
g_strRemoteHost = txtHost.Text
g_intPort = CLng(txtPort.Text)
If optnUser Then
g_Control = LOGINSERVER
g_strName = txtName.Text
g_strPwd = txtPwd.Text
g_selfName = g_strName
g_selfPwd = g_strPwd
Else
g_Control = REGCONTROL
End If
'连接服务器
ConnectRemoteHost txtHost.Text, CLng(txtPort.Text)
End Sub
Private Sub Form_Load()
frmLogin.Height = 4000
End Sub
Private Sub optnGuest_Click()
Frame1.Visible = False
frmLogin.Height = frmLogin.Height - Frame1.Height - 200
cmdLogin.Top = Frame1.Top
End Sub
Private Sub optnUser_Click()
Frame1.Visible = True
frmLogin.Height = frmLogin.Height + Frame1.Height + 200
cmdLogin.Top = cmdLogin.Top + Frame1.Height + 200
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -