📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登录"
ClientHeight = 1665
ClientLeft = 2835
ClientTop = 3480
ClientWidth = 3915
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 983.737
ScaleMode = 0 'User
ScaleWidth = 3675.973
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox TxtServerIp
Height = 344
Left = 1290
TabIndex = 4
Top = 600
Width = 2325
End
Begin VB.TextBox txtUserName
Height = 344
Left = 1320
TabIndex = 1
Top = 120
Width = 2325
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 390
Left = 1200
TabIndex = 2
Top = 1200
Width = 1140
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "服务器IP:"
Height = 180
Left = 120
TabIndex = 3
Top = 600
Width = 900
End
Begin VB.Label lblLabels
Caption = "用户名称:"
Height = 270
Index = 0
Left = 105
TabIndex = 0
Top = 150
Width = 1080
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdOK_Click()
If txtUserName = "" Or TxtServerIp = "" Then
'检查信息是否完整
MsgBox "请填写完整信息!", vbOKOnly, "信息不全"
txtUserName.SetFocus
End If
Form1.Winsock1.Connect TxtServerIp, 2001
Do Until Form1.Winsock1.State = 7
'等待连接成功后再发送
DoEvents
Loop
Form1.Winsock1.SendData "~ni~" & "|" & "~ai~" & "|" & LenInfo(txtUserName) & txtUserName
'“~ni~”为不在聊天室标志
'“~ai~”为登录标志
NowUser = txtUserName
'激活各个按钮
With Form1
.Command1.Enabled = True
.Command2.Enabled = True
.Command3.Enabled = True
End With
Unload Me
End Sub
Private Sub Form_Load()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -