home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
- Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
- Begin VB.Form PlatWSCont41Clnt
- BackColor = &H00FFFFFF&
- Caption = "Platinum Ch 41 Client"
- ClientHeight = 5595
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 5880
- ForeColor = &H00000000&
- LinkTopic = "Form1"
- ScaleHeight = 5595
- ScaleWidth = 5880
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton cmdReadLocalPort
- Caption = "Read LocalPort"
- Height = 375
- Left = 3960
- TabIndex = 14
- Top = 5160
- Width = 1695
- End
- Begin VB.CommandButton cmdSetRemotePort
- Caption = "Set RemotePort"
- Height = 375
- Left = 3960
- TabIndex = 13
- Top = 4740
- Width = 1695
- End
- Begin VB.CommandButton cmdSetRemoteHost
- Caption = "Set RemoteHost"
- Height = 375
- Left = 3960
- TabIndex = 12
- Top = 4320
- Width = 1695
- End
- Begin VB.TextBox txtLocalPort
- Height = 375
- Left = 1920
- TabIndex = 11
- Text = "LocalPort"
- Top = 5160
- Width = 1995
- End
- Begin VB.TextBox txtRemotePort
- Height = 375
- Left = 1920
- TabIndex = 9
- Text = "1001"
- Top = 4740
- Width = 1995
- End
- Begin VB.TextBox txtRemoteHost
- Height = 375
- Left = 1920
- TabIndex = 7
- Text = "RemoteHost"
- Top = 4320
- Width = 1995
- End
- Begin VB.CommandButton cmdConnect
- BackColor = &H00E0E0E0&
- Caption = "Connect"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 615
- Left = 180
- TabIndex = 5
- Top = 180
- Width = 915
- End
- Begin MSWinsockLib.Winsock wskClient
- Left = 4980
- Top = 240
- _ExtentX = 741
- _ExtentY = 741
- End
- Begin RichTextLib.RichTextBox rtbClntOutBound
- Height = 1215
- Left = 180
- TabIndex = 1
- Top = 1260
- Width = 5475
- _ExtentX = 9657
- _ExtentY = 2143
- _Version = 327680
- Enabled = -1 'True
- MousePointer = 3
- TextRTF = $"PlatWSCont41Clnt.frx":0000
- End
- Begin RichTextLib.RichTextBox rtbClntInBound
- Height = 1215
- Left = 180
- TabIndex = 2
- Top = 3000
- Width = 5475
- _ExtentX = 9657
- _ExtentY = 2143
- _Version = 327680
- Enabled = -1 'True
- TextRTF = $"PlatWSCont41Clnt.frx":00D8
- End
- Begin VB.Label lblLocalPort
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- Caption = "LocalPort"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 375
- Index = 1
- Left = 180
- TabIndex = 10
- Top = 5160
- Width = 1695
- End
- Begin VB.Label lblRemotePort
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- Caption = "RemotePort"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 375
- Index = 1
- Left = 180
- TabIndex = 8
- Top = 4740
- Width = 1695
- End
- Begin VB.Label lblRemoteHost
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- Caption = "RemoteHost"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 375
- Left = 180
- TabIndex = 6
- Top = 4320
- Width = 1695
- End
- Begin VB.Label lblClntInBnd
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- Caption = "Inbound"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 375
- Index = 0
- Left = 180
- TabIndex = 4
- Top = 2580
- Width = 5475
- End
- Begin VB.Label lblClntOutBnd
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- Caption = "Outbound"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 375
- Left = 180
- TabIndex = 3
- Top = 840
- Width = 5475
- End
- Begin VB.Label lblClient
- Alignment = 2 'Center
- BackColor = &H000000FF&
- BorderStyle = 1 'Fixed Single
- Caption = "The Client"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 24
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 615
- Left = 1140
- TabIndex = 0
- Top = 180
- Width = 3615
- End
- Attribute VB_Name = "PlatWSCont41Clnt"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub cmdConnect_Click()
- 'The command button click event is used to create the connection.
- ' The connection request string is sent to the RemoteHost on the RemotePort.
- ' The Connect method takes two arguements, in the form of
- ' object.Connect remoteHost, remotePort
- ' If the two properties are blank and the arguments are not supplied an error
- ' occurs. The two properties were set in the Form_Load event which occurs
- ' prior to the Command_Click event.
- wskClient.Connect
- End Sub
- Private Sub cmdReadLocalPort_Click()
- 'This will read and display the value of the LocalPort property in
- ' txtLocalPort.Text
- txtLocalPort.Text = wskClient.LocalPort
- End Sub
- Private Sub cmdSetRemoteHost_Click()
- 'This will set the value of the RemoteHost property to the value in
- ' txtRemoteHost.Text
- wskClient.RemoteHost = txtRemoteHost.Text
- End Sub
- Private Sub cmdSetRemotePort_Click()
- 'This will set the value of the RemotePort property to the value in
- ' txtRemotePort.Text
- wskClient.RemotePort = txtRemotePort.Text
- End Sub
- Private Sub Form_Load()
- 'The name of the Winsock control for the client is wskClient
- ' This name is the object when setting a property such as
- ' object.property or wskClient.Property
- 'The name of the remote host can be set at design time in the
- ' properties dialog or it can be set at runtime in code.
- ' Either the IP address "XXX.XXX.XXX.XXX" or a host friendly
- ' name may be used such as "http://www.microsoft.com"
- ' The RemoteHost property has a data type of string.
- wskClient.RemoteHost = "SomeJunk"
- 'The RemotePort property can be set at design time or in code at runtime.
- ' The RemotePort property has a data type of Long Integer.
- ' This is port number on which the Server will be listening.
- wskClient.RemotePort = 1002
- End Sub
- Private Sub rtbClntOutBound_Change()
- 'The RichTextBox_Change event is being used to send data. The contents of the
- ' RichTextBox rtbClntOutBound will be transmitted each time the contents of the
- ' Text property is changed. The SendData method is used with the argument of
- ' RichTextBox.Text
- wskClient.SendData rtbClntOutBound.Text
- End Sub
- Private Sub wskClient_DataArrival(ByVal bytesTotal As Long)
- 'The variable strData is declared to hold the incoming data. It is stored as
- ' a variant.
- Dim strData As String
- 'The GetData method takes the data from the incoming buffer and places it in
- ' the strData variable.
- wskClient.GetData strData
- 'The strData variable contents are placed in the RichTextBox rtbClntInBound.Text
- ' property
- rtbClntInBound.Text = strData
- End Sub
-