home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
- Begin VB.Form Client2
- BackColor = &H00000000&
- Caption = "Price Lookup"
- ClientHeight = 4275
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6300
- LinkTopic = "Form2"
- ScaleHeight = 4275
- ScaleWidth = 6300
- StartUpPosition = 3 'Windows Default
- Begin VB.TextBox txtItem
- BackColor = &H00FFFFFF&
- Height = 285
- Left = 1800
- TabIndex = 5
- Top = 1080
- Width = 1215
- End
- Begin VB.Frame Frame1
- BackColor = &H00000000&
- Height = 735
- Left = 0
- TabIndex = 0
- Top = 3480
- Width = 6255
- Begin VB.CommandButton cmdConnect
- Caption = "Connect"
- Height = 375
- Left = 3120
- TabIndex = 8
- Top = 240
- Width = 1455
- End
- Begin MSWinsockLib.Winsock Winsock1
- Left = 2280
- Top = 240
- _ExtentX = 741
- _ExtentY = 741
- _Version = 393216
- End
- Begin VB.CommandButton cmdClose
- Caption = "Close"
- Height = 375
- Left = 4680
- TabIndex = 2
- Top = 240
- Width = 1455
- End
- Begin VB.CommandButton cmdSend
- BackColor = &H00000000&
- Caption = "Lookup"
- Height = 375
- Left = 120
- Picture = "Client2.frx":0000
- TabIndex = 1
- Top = 240
- Width = 1455
- End
- End
- Begin VB.Label lblPrice
- BorderStyle = 1 'Fixed Single
- Height = 285
- Left = 1800
- TabIndex = 7
- Top = 1560
- Width = 1215
- End
- Begin VB.Label lblMessage
- BackColor = &H80000008&
- ForeColor = &H00C00000&
- Height = 255
- Left = 240
- TabIndex = 6
- Top = 120
- Width = 2535
- End
- Begin VB.Line Line4
- BorderColor = &H00808080&
- X1 = 0
- X2 = 6240
- Y1 = 480
- Y2 = 480
- End
- Begin VB.Shape shpWait
- BackColor = &H0000FFFF&
- BackStyle = 1 'Opaque
- Height = 135
- Left = 5760
- Shape = 3 'Circle
- Top = 120
- Visible = 0 'False
- Width = 255
- End
- Begin VB.Shape shpGo
- BackColor = &H00808000&
- BackStyle = 1 'Opaque
- Height = 135
- Left = 5520
- Shape = 3 'Circle
- Top = 120
- Visible = 0 'False
- Width = 255
- End
- Begin VB.Shape shpError
- BackColor = &H000000FF&
- BackStyle = 1 'Opaque
- Height = 135
- Left = 6000
- Shape = 3 'Circle
- Top = 120
- Visible = 0 'False
- Width = 135
- End
- Begin VB.Label LblLKPrice
- BackStyle = 0 'Transparent
- Caption = "Price"
- ForeColor = &H0000FFFF&
- Height = 255
- Left = 480
- TabIndex = 4
- Top = 1560
- Width = 735
- End
- Begin VB.Label lblItem
- BackStyle = 0 'Transparent
- Caption = "Item Number"
- ForeColor = &H0000FFFF&
- Height = 255
- Left = 480
- TabIndex = 3
- Top = 1080
- Width = 1095
- End
- Attribute VB_Name = "Client2"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub cmdClose_Click()
- Winsock1.Close
- shpGo.Visible = False
- shpWait.Visible = False
- shpError.Visible = True
- End Sub
- Private Sub cmdConnect_Click()
- Winsock1.RemoteHost = "127.0.0.1"
- Winsock1.RemotePort = 1007
- Winsock1.Connect
- shpGo.Visible = True
- txtItem.SetFocus
- End Sub
- Private Sub cmdSend_Click()
- If Winsock1.State = sckConnected Then
- Winsock1.SendData txtItem.Text
- shpGo.Visible = True
- lblMessage.Caption = "Sending Data"
- Else
- shpGo.Visible = False
- shpWait.Visible = False
- shpError.Visible = True
- lblMessage.Caption = "Not currently connected to host"
- End If
- End Sub
- Private Sub Form_Load()
- End Sub
- Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
- Dim sData As String
- Winsock1.GetData sData, vbString
- lblPrice.Caption = sData
- lblMessage.Caption = "Received data"
- shpGo.Visible = True
- shpWait.Visible = False
- shpError.Visible = False
-
- End Sub
- Private Sub Winsock1_SendComplete()
- lblMessage.Caption = "Completed Data Transmission"
- End Sub
-