Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing Server/UsersForm.frm (4.44 KB)
VERSION 5.00
Begin VB.Form UsersForm
BorderStyle = 3 'Fixed Dialog
Caption = "RemoteAmp Server - Users Connected"
ClientHeight = 3135
ClientLeft = 45
ClientTop = 330
ClientWidth = 4575
ClipControls = 0 'False
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "UsersForm.frx":0000
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3135
ScaleWidth = 4575
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.Timer UpdateTimer
Interval = 3000
Left = 3360
Top = 120
End
Begin VB.CommandButton Command2
Caption = "&Kick User"
Enabled = 0 'False
Height = 375
Left = 3240
TabIndex = 1
Top = 2160
Width = 1215
End
Begin VB.CommandButton Command1
Cancel = -1 'True
Caption = "Close"
Default = -1 'True
Height = 375
Left = 3240
TabIndex = 2
Top = 2640
Width = 1215
End
Begin VB.ListBox List1
Height = 2400
ItemData = "UsersForm.frx":000C
Left = 120
List = "UsersForm.frx":000E
TabIndex = 0
Top = 120
Width = 3015
End
Begin VB.Image Image1
Height = 480
Left = 3600
Picture = "UsersForm.frx":0010
Top = 840
Width = 480
End
Begin VB.Label Label1
Caption = "Total Users Connected: 0"
Height = 255
Left = 120
TabIndex = 3
Top = 2760
Width = 1935
End
End
Attribute VB_Name = "UsersForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
If MsgBox("Are you sure you want to kick this user?", vbYesNo + vbQuestion) = vbYes Then
MainForm.WinsockArray(List1.ListIndex + 1).Close
Unload MainForm.WinsockArray(List1.ListIndex + 1)
List1.RemoveItem List1.ListIndex
Label1.Caption = "Total Users Connected: " & MainForm.WinsockArray.UBound
Command2.Enabled = False
End If
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = MainForm.WinsockArray.LBound + 1 To MainForm.WinsockArray.UBound
List1.AddItem IIf(Val(MainForm.WinsockArray(i).Tag) = 0, "* ", "") & MainForm.WinsockArray(i).RemoteHostIP & IIf(MainForm.WinsockArray(i).RemoteHost <> "", " (" & MainForm.WinsockArray(i).RemoteHost & ")", "")
Next i
Label1.Caption = "Total Users Connected: " & MainForm.WinsockArray.UBound
End Sub
Private Sub Form_Unload(Cancel As Integer)
MainForm.Label9.Caption = MainForm.WinsockArray.UBound & "/" & Val(MainForm.Text2.Text) & " users connected."
End Sub
Private Sub List1_Click()
Command2.Enabled = True
End Sub
Private Sub List1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If List1.ListIndex = 0 Then
List1.ToolTipText = ""
Else
List1.ToolTipText = List1.List(List1.ListIndex)
End If
End Sub
Private Sub UpdateTimer_Timer()
Dim i As Integer
Dim OldListIndex As Integer
OldListIndex = List1.ListIndex
List1.Clear
For i = MainForm.WinsockArray.LBound + 1 To MainForm.WinsockArray.UBound
List1.AddItem IIf(Val(MainForm.WinsockArray(i).Tag) = 0, "* ", "") & MainForm.WinsockArray(i).RemoteHostIP & IIf(MainForm.WinsockArray(i).RemoteHost <> "", " (" & MainForm.WinsockArray(i).RemoteHost & ")", "")
Next i
Label1.Caption = "Total Users Connected: " & MainForm.WinsockArray.UBound
If OldListIndex < List1.ListCount Then
List1.ListIndex = OldListIndex
Else
Command2.Enabled = False
End If
End Sub