⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 本程序客户端可以实现学生对号入座
💻 FRM
字号:
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
'为进入的数据声明一个变量。
   winsock1(Index).GetData strData
   sData = Split(strData, "|")
  flag = False
    Select Case UCase(sData(0))
        Case "LOG"                                         '如果数据的第一位是“^”,说明是客户端作出了退出申请
            Label1.Caption = sData(1)
'            rsRecordSet.Open ("SELECT * FROM qmcj where 序号=" & "'" & sData(1) & "'")
'            connConnection.Execute ("UPDATE qmcj SET 类别 = 1 WHERE 序号=" & "'" & sData(1) & "'")
            sdstr = "王添" 'rsRecordSet!姓名
            Label2.Caption = sdstr
            winsock1(Index).SendData "dlfk|" + "3班|" + sdstr  '登录反馈信息
'            rsRecordSet.Close
    End Select
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -