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

📄 formconnect.frm

📁 用于远程视频监控的源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form2 
   BackColor       =   &H00404040&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Start New Game..."
   ClientHeight    =   4410
   ClientLeft      =   45
   ClientTop       =   615
   ClientWidth     =   5025
   Icon            =   "FormConnect.frx":0000
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "FormConnect.frx":030A
   ScaleHeight     =   4410
   ScaleWidth      =   5025
   StartUpPosition =   2  'CenterScreen
   Begin VB.PictureBox Picture1 
      BackColor       =   &H00404040&
      BorderStyle     =   0  'None
      Height          =   615
      Left            =   270
      ScaleHeight     =   615
      ScaleWidth      =   2100
      TabIndex        =   12
      Top             =   2685
      Width           =   2100
      Begin VB.OptionButton OPColor1 
         BackColor       =   &H000000FF&
         ForeColor       =   &H000000FF&
         Height          =   240
         Left            =   45
         Style           =   1  'Graphical
         TabIndex        =   18
         Top             =   45
         Width           =   600
      End
      Begin VB.OptionButton OPColor2 
         BackColor       =   &H000080FF&
         Height          =   240
         Left            =   750
         Style           =   1  'Graphical
         TabIndex        =   17
         Top             =   45
         Value           =   -1  'True
         Width           =   600
      End
      Begin VB.OptionButton OPColor3 
         BackColor       =   &H0000FFFF&
         Height          =   240
         Left            =   1455
         Style           =   1  'Graphical
         TabIndex        =   16
         Top             =   45
         Width           =   600
      End
      Begin VB.OptionButton OPColor4 
         BackColor       =   &H0000FF00&
         Height          =   240
         Left            =   45
         Style           =   1  'Graphical
         TabIndex        =   15
         Top             =   345
         Width           =   600
      End
      Begin VB.OptionButton OPColor5 
         BackColor       =   &H00FF0000&
         Height          =   240
         Left            =   750
         Style           =   1  'Graphical
         TabIndex        =   14
         Top             =   345
         Width           =   600
      End
      Begin VB.OptionButton OPColor6 
         BackColor       =   &H00FF00FF&
         Height          =   240
         Left            =   1455
         Style           =   1  'Graphical
         TabIndex        =   13
         Top             =   345
         Width           =   600
      End
   End
   Begin VB.CommandButton Command2 
      BackColor       =   &H00808080&
      Caption         =   "Cancel"
      Height          =   360
      Left            =   2655
      Style           =   1  'Graphical
      TabIndex        =   11
      Top             =   3525
      Width           =   1545
   End
   Begin VB.TextBox txtMyIP 
      BackColor       =   &H00000000&
      ForeColor       =   &H0000FF00&
      Height          =   315
      Left            =   1035
      TabIndex        =   10
      Top             =   1605
      Width           =   2460
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H00808080&
      Caption         =   "Connect..."
      Height          =   360
      Left            =   915
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   3525
      Width           =   1530
   End
   Begin VB.TextBox TxtName 
      BackColor       =   &H00000000&
      ForeColor       =   &H0000FF00&
      Height          =   345
      Left            =   2655
      MaxLength       =   17
      TabIndex        =   7
      Text            =   "Timbo RULES!!!!"
      Top             =   2850
      Width           =   2025
   End
   Begin VB.TextBox TxtREIP 
      BackColor       =   &H00000000&
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   330
      Left            =   2655
      TabIndex        =   4
      Text            =   "209.213.228.133"
      Top             =   570
      Width           =   1935
   End
   Begin VB.OptionButton Option2 
      BackColor       =   &H00808080&
      Caption         =   "C l i e n t"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   360
      Left            =   255
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   765
      Width           =   1500
   End
   Begin VB.OptionButton Option1 
      BackColor       =   &H00808080&
      Caption         =   "S e r v e r"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   360
      Left            =   240
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   255
      Value           =   -1  'True
      Width           =   1485
   End
   Begin VB.Label LBLCStatus 
      BackStyle       =   0  'Transparent
      Caption         =   "Not Connected..."
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   285
      Left            =   60
      TabIndex        =   20
      Top             =   4125
      Width           =   4875
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "Enter server IP address:"
      ForeColor       =   &H0000C000&
      Height          =   210
      Left            =   2640
      TabIndex        =   19
      Top             =   360
      Width           =   1815
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "Your IP Address:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   240
      Left            =   1530
      TabIndex        =   9
      Top             =   1365
      Width           =   1485
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "TAG Name:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   255
      Left            =   2640
      TabIndex        =   6
      Top             =   2625
      Width           =   1065
   End
   Begin VB.Label Label3 
      BackColor       =   &H00404040&
      Caption         =   "Choose your Color..."
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   240
      Index           =   1
      Left            =   270
      TabIndex        =   5
      Top             =   2460
      Width           =   1860
   End
   Begin VB.Shape Shape3 
      BorderColor     =   &H000080FF&
      BorderWidth     =   2
      Height          =   840
      Left            =   180
      Top             =   2520
      Width           =   2250
   End
   Begin VB.Label Label3 
      BackColor       =   &H00404040&
      BackStyle       =   0  'Transparent
      Caption         =   "Connect to..."
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   240
      Index           =   0
      Left            =   2655
      TabIndex        =   3
      Top             =   75
      Width           =   1200
   End
   Begin VB.Shape Shape2 
      BorderColor     =   &H00C0C0C0&
      Height          =   870
      Left            =   2460
      Top             =   270
      Width           =   2340
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "*Be sure you are connected to the internet."
      ForeColor       =   &H0000C000&
      Height          =   270
      Left            =   735
      TabIndex        =   2
      Top             =   1965
      Width           =   3105
   End
   Begin VB.Menu mnugame 
      Caption         =   "&Game"
      Begin VB.Menu mnuhelp 
         Caption         =   "&Help"
      End
      Begin VB.Menu mnuquit 
         Caption         =   "Quit"
      End
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Load Form1
MyTagName = TxtName.Text
If txtMyIP.Text = "" Then 'Check for common errors...
MsgBox "TAG was unable to detect your current IP address, but will continue anyways..."
txtMyIP.Enabled = True
txtMyIP.SetFocus
ElseIf TAGHost = False And TxtREIP.Text = "" Then
MsgBox "Please provide a server IP address to connect to..."
TxtREIP.SetFocus
ElseIf TxtName.Text = "" Or TxtName.Text = " " Or TxtName.Text = "  " Or TxtName.Text = "   " Or TxtName.Text = "    " Or TxtName.Text = "     " Or TxtName.Text = "      " Or TxtName.Text = "       " Or TxtName.Text = "        " Or TxtName.Text = "         " Then
 ErrorMsg1
Else  'Check was passed, move on...
Form1.ws.Close
   If Option2.Value = True Then
    TAGHost = False
    Else
    TAGHost = True
   End If
 If TAGHost = True Then
 
 'Connect as server...
 Form1.ws.LocalPort = 5050
   LBLCStatus.Caption = "Initializing Connection..."
  Form1.ws.Listen
 
 LBLCStatus.Caption = "Awaiting Players..."
 Form1.Circle1.BorderColor = 0
 Form1.Circle2.BorderColor = &HFFFF&
 Call URIT
' CircX = 525
'CircY = 1806
'Circle1.Left = CircX
'Circle1.Top = CircY
'OpCircX = 4155
'OpCircY = 1620
'Circle2.Left = OpCircX
'Circle2.Top = OpCircY
'your not it code here
 Form1.Circle1.BackColor = MyColor
 ElseIf TAGHost = False Then
 'Connect as Player...
   Form1.ws.RemoteHost = TxtREIP.Text
   Form1.ws.RemotePort = 5050
   LBLCStatus.Caption = "Connecting to Host..."
   
   'Comment next line for offline show...
'CircX = 4155
'CircY = 1620
'Form1.Circle1.Left = CircX
'Form1.Circle1.Top = CircY
'OpCircX = 525
'OpCircY = 1806
'Form1.Circle2.Left = OpCircX
'Form1.Circle2.Top = OpCircY
   'UC
'   Form1.ws.Connect
   Form1.Circle1.BorderColor = &HFFFF&
   Form1.Circle2.BorderColor = 0
   Form1.Circle1.BackColor = MyColor
   
 Call URnotIT
 
   Me.Hide
   Paused = True
   Form1.Show
   Form1.TypeMatrix Form1.lblTr.Caption + Chr(13) + "Connecting to " + TxtREIP.Text + "..."
   'let the user know we're connecting, and then set the
   'picturebox focus so the game works right
   Form1.PArena.SetFocus
   Unload Me
 End If
End If
End Sub

Private Sub Command2_Click()
'they pressed disconnect...
LBLCStatus.Caption = "Disconnecting..."
Form1.ws.Close 'close the connection...
LBLCStatus.Caption = "Connection Canceled..."
End Sub

Private Sub Form_Load()
MyColorNum = 2
MyColor = TAGColor2
Dim m
txtMyIP.Text = GetIPAddress()
   If txtMyIP.Text = "127.0.0.1" Then
m = "NOT CONNECTED" + Chr(13) + "Make sure that you are currently connected to the internet"
   Else
Label2.Caption = "You are Online"
End If
Paused = True
End Sub

Private Sub mnuquit_Click()
Dim m
m = MsgBox("Are you sure you want to quit yar-interactive TAG?", vbYesNo, "Quit?")
If m = vbYes Then
Unload Me
End
Else
Exit Sub
End If
End Sub

'these subs below convert the color that they select to the variables
'that send and handle color data...
Private Sub OPColor1_Click()
Shape3.BorderColor = &HFF&
MyColor = &HFF&
MyColorNum = 1
End Sub
Private Sub OPColor2_Click()
Shape3.BorderColor = &H80FF&
MyColor = &H80FF&
MyColorNum = 2
End Sub
Private Sub OPColor3_Click()
Shape3.BorderColor = &HFFFF&
MyColor = &HFFFF&
MyColorNum = 3
End Sub
Private Sub OPColor4_Click()
Shape3.BorderColor = &HFF00&
MyColor = &HFF00&
MyColorNum = 4
End Sub
Private Sub OPColor5_Click()
Shape3.BorderColor = &HFF0000
MyColor = &HFF0000
MyColorNum = 5
End Sub
Private Sub OPColor6_Click()
Shape3.BorderColor = &HFF00FF
MyColor = &HFF00FF
MyColorNum = 6
End Sub

Private Sub Option1_Click()
TxtREIP.Enabled = False
'Your the server
TAGHost = True
End Sub

Private Sub Option2_Click()
TxtREIP.Enabled = True
'Your the client...
TAGHost = False
End Sub

Public Sub ErrorMsg1()
MsgBox "Invalid Player name, please choose a diferent name..."
TxtName.SetFocus
End Sub

⌨️ 快捷键说明

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