请看这段VB代码中的"红"数字, 我的问题是,这些数字是编程者自定义的,还是winsock内容定义的对应不同含义的代码?如为后者,最好给出更全的代码及其含义列表.
Public Function Handle_Data(strData As String, sSock As Winsock) As String
Dim strRead() As String, intCount As Integer
    'I use the Array *strRead()* to split the data using a seperator
    strRead() = Split(strData$, Sep)
    With frmServer
        
        'I use the Second number in the Data to intentify what function it is.
        Select Case strRead(2)
            '** Login
            Case "92"
                .lstOnline.AddItem strRead(4)
                sSock.Tag = LCase(strRead(4))
                
                Pause (0.2)
                
                'Sends a list of the Clients
                Call sSock.SendData(SendClientList)
                
                Pause (0.2)
                
                'Sends the newclient login to all connected clients
                For intCount% = 1 To .Ws().UBound
                    Select Case .Ws(intCount%).State
                        Case Is = sckConnected
                            .Ws(intCount%).SendData NewClient(strRead(4))
                            DoEvents%
                    End Select
                Next intCount%
                
                'Displays data
                Call Add_Data("Login", strData$)
            '** Send ChatText to all the clients
            Case "03"
                'Sends data
                For intCount% = 1 To .Ws().UBound
                    Select Case .Ws(intCount%).State
                        Case Is = sckConnected
                            .Ws(intCount%).SendData strData$
                            DoEvents%
                    End Select
                Next intCount%
                
                'Displays ChatText in the Server
                .txtChat.Text = .txtChat.Text & strRead(3) & ": " & strRead(4) & vbCrLf
                .txtChat.SelStart = Len(.txtChat.Text)
                
                Call Add_Data("Chat Send", strData$)
            '** Whisper
            Case "05"
                'If the user is not found, we exit the function
                If FindSock(strRead(3)) = "11111" Then Exit Function
            
                'Send to client
                .Ws(FindSock(strRead(3))).SendData Whisper(strRead(3), sSock.Tag, strRead(4))
                DoEvents%
                
                Call Add_Data("Whisper", strData$)
            '** Client LOGOFF
            Case "831"
                'Removes user
                Call Remove_User(sSock.Tag, .lstOnline)
                
                Pause (0.1)
                
                'Notifys everybody of this clients logoff
                For intCount% = 1 To .Ws().UBound
                    Select Case .Ws(intCount%).State
                        Case Is = sckConnected
                            .Ws(intCount%).SendData strData$
                            DoEvents%
                    End Select
                Next intCount%
                
                'Clears tag so we can accept the next incoming connection
                sSock.Tag = ""
                
                Call Add_Data("Logout", strData$)
        End Select
        
    End With
End Function

解决方案 »

  1.   

    但是我没找到定义的代码,上文中的strData As String,也是简单地在DataArrival事件中接收的,发送端代码也没看到这些数字
      

  2.   

    把源码发给我研究一下可好??398706948   [email protected]
      

  3.   

    这些数字是编程者自定义的
    在整个工程里搜索strRead找找
      

  4.   


    这些是编程的人自己定义的定义的意思是,这些数字他知道怎么处理,但是,你别想找到和它相关dim什么的东西。就好像你输入个数字,然后你的程序安装你输入的数字来决定分支一样,只有你知道怎么分支,别人也只有看程序和注释才知道是代表什么意义