?? 服務(wù)器.frm
字號(hào):
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form1
Caption = "服務(wù)器"
ClientHeight = 3150
ClientLeft = 60
ClientTop = 345
ClientWidth = 5085
LinkTopic = "Form1"
ScaleHeight = 3150
ScaleWidth = 5085
StartUpPosition = 3 '窗口缺省
Begin MSWinsockLib.Winsock Winsock1
Index = 0
Left = 2280
Top = 1320
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
Begin VB.TextBox Text3
Height = 375
Left = 960
TabIndex = 0
Text = "0"
Top = 240
Width = 1575
End
Begin VB.Label Label1
Caption = "在線人數(shù)"
Height = 255
Left = 120
TabIndex = 1
Top = 360
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Gac() As Boolean
Dim Socknumber As Integer
Private Sub Form_Load()
Winsock1(0).LocalPort = 1600
Winsock1(0).Listen
Socknumber = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
Winsock1(0).Close
End Sub
Private Sub Winsock1_Close(Index As Integer)
Winsock1(Index).Close
Unload Winsock1(Index)
Gac(Index) = False
Text3.Text = Int(Text3.Text) - 1
End Sub
Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal requestID As Long)
Socknumber = Socknumber + 1
Load Winsock1(Socknumber)
Winsock1(Socknumber).Accept requestID
ReDim Preserve Gac(Socknumber)
Gac(Socknumber) = True
Text3.Text = Int(Text3.Text) + 1
End Sub
Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim c As String
Winsock1(Index).GetData c, vbString
Dim i As Integer
For i = 1 To UBound(Gac)
If Not i = Index Then
If Gac(i) Then
Winsock1(i).SendData c
DoEvents
End If
End If
Next i
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -