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

📄 form1.frm

📁 the Customer programs in vb for a connection server winsock, client - server
💻 FRM
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3165
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4350
   LinkTopic       =   "Form1"
   ScaleHeight     =   3165
   ScaleWidth      =   4350
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1 
      Caption         =   "REConetar"
      Height          =   375
      Left            =   135
      TabIndex        =   7
      Top             =   135
      Width           =   1590
   End
   Begin MSWinsockLib.Winsock tcp 
      Left            =   1980
      Top             =   1350
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.TextBox txtip 
      Height          =   330
      Left            =   2565
      TabIndex        =   0
      Text            =   "10.10.0.15"
      Top             =   90
      Width           =   1545
   End
   Begin VB.Label lblEstado 
      Alignment       =   2  'Center
      BackColor       =   &H00E0E0E0&
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   0
      TabIndex        =   6
      Top             =   2790
      Width           =   4380
   End
   Begin VB.Label Label3 
      Caption         =   "Nombre de Maquina"
      Height          =   195
      Left            =   270
      TabIndex        =   5
      Top             =   1710
      Width           =   1725
   End
   Begin VB.Label Label1 
      Caption         =   "Direccion IP"
      Height          =   195
      Left            =   405
      TabIndex        =   4
      Top             =   720
      Width           =   1095
   End
   Begin VB.Label lblMaquina 
      Alignment       =   2  'Center
      Caption         =   "xxxx"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   21.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   555
      Left            =   315
      TabIndex        =   3
      Top             =   1890
      Width           =   3660
   End
   Begin VB.Label Label2 
      Caption         =   "Servidor:"
      Height          =   240
      Left            =   1845
      TabIndex        =   2
      Top             =   180
      Width           =   735
   End
   Begin VB.Label lblip 
      Alignment       =   2  'Center
      Caption         =   "xxxx"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   21.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   555
      Left            =   405
      TabIndex        =   1
      Top             =   945
      Width           =   3660
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
conectar
End Sub

Private Sub Form_Load()
lblip.Caption = tcp.LocalIP
lblMaquina.Caption = tcp.LocalHostName
Call conectar
End Sub
Private Sub conectar()



     tcp.Close
     tcp.RemoteHost = CStr(txtip.Text)
     tcp.RemotePort = CInt("1300")
     tcp.Connect
End Sub




Private Sub tcp_Connect()
      On Error GoTo VA
    lblEstado.Caption = "Conectado al Servidor"
    tcp.SendData tcp.LocalHostName
   
    Exit Sub
VA:
    lblEstado.Caption = "(5) Ups, Esta macana falla en el conectado" & vbCrLf & "Cierre y vuelva a intentarlo"

End Sub

Private Sub tcp_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
       lblEstado.Caption = "auxilio no me puedo conectar"
End Sub

⌨️ 快捷键说明

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