?? form1.frm
字號(hào):
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 1260
ClientLeft = 4770
ClientTop = 4500
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 1260
ScaleWidth = 4680
Begin MSWinsockLib.Winsock winsock1
Index = 0
Left = 3960
Top = 240
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
Begin VB.Label Label2
Caption = "Label2"
Height = 615
Left = 1800
TabIndex = 1
Top = 240
Width = 1575
End
Begin VB.Label Label1
Caption = "Label1"
Height = 495
Left = 480
TabIndex = 0
Top = 240
Width = 855
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private intMax As Long
Private Sub Form_Load()
Dim sdstr As String, dstr As String, tstr As String
Dim txtstr As String
intMax = 0
winsock1(0).LocalPort = 5200
winsock1(0).Listen
End Sub
Private Sub winsock1_ConnectionRequest(Index As Integer, ByVal requestID As Long)
If Index = 0 Then
intMax = intMax + 1
Load winsock1(intMax)
winsock1(intMax).LocalPort = 0
winsock1(intMax).Accept requestID
End If
End Sub
Private Sub winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim strData As String, i As Integer, sdstr As String, sData() As String
Dim flag As Boolean
'為進(jìn)入的數(shù)據(jù)聲明一個(gè)變量。
winsock1(Index).GetData strData
sData = Split(strData, "|")
flag = False
Select Case UCase(sData(0))
Case "LOG" '如果數(shù)據(jù)的第一位是“^”,說(shuō)明是客戶端作出了退出申請(qǐng)
Label1.Caption = sData(1)
' rsRecordSet.Open ("SELECT * FROM qmcj where 序號(hào)=" & "'" & sData(1) & "'")
' connConnection.Execute ("UPDATE qmcj SET 類別 = 1 WHERE 序號(hào)=" & "'" & sData(1) & "'")
sdstr = "王添" 'rsRecordSet!姓名
Label2.Caption = sdstr
winsock1(Index).SendData "dlfk|" + "3班|" + sdstr '登錄反饋信息
' rsRecordSet.Close
End Select
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -