| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files/SMSC client .NET/samples/vb-net/UCP/ |
Upload File : |
'------------------------------------------------------------------------------
' SMSC client .NET components UCP sample application
'
' $Header: $
' Copyright (c) 2003-2013 Tops. All rights reserved.
'------------------------------------------------------------------------------
Option Strict Off
Option Explicit On
Imports System.Windows.Forms
Imports smscc
Imports smscc.UCP
Friend Class fmMain
Inherits System.Windows.Forms.Form
#Region "Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
If Disposing Then
If Not components Is Nothing Then
components.Dispose()
End If
End If
MyBase.Dispose(Disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
Public WithEvents chkDirectDisplay As System.Windows.Forms.CheckBox
Public WithEvents chkStatusReport As System.Windows.Forms.CheckBox
Public WithEvents txtUDH As System.Windows.Forms.TextBox
Public WithEvents cbEncoding As System.Windows.Forms.ComboBox
Public WithEvents txtOriginator As System.Windows.Forms.TextBox
Public WithEvents cmdInitialize As System.Windows.Forms.Button
Public WithEvents txtDestination As System.Windows.Forms.TextBox
Public WithEvents txtLog As System.Windows.Forms.TextBox
Public WithEvents cmdDisconnect As System.Windows.Forms.Button
Public WithEvents txtPort As System.Windows.Forms.TextBox
Public WithEvents txtHost As System.Windows.Forms.TextBox
Public WithEvents cmdConnect As System.Windows.Forms.Button
Public WithEvents Label17 As System.Windows.Forms.Label
Public WithEvents Line3 As System.Windows.Forms.Label
Public WithEvents Label16 As System.Windows.Forms.Label
Public WithEvents Line2 As System.Windows.Forms.Label
Public WithEvents Line1 As System.Windows.Forms.Label
Public WithEvents Label9 As System.Windows.Forms.Label
Public WithEvents Label3 As System.Windows.Forms.Label
Public WithEvents Label7 As System.Windows.Forms.Label
Public WithEvents Label6 As System.Windows.Forms.Label
Public WithEvents Label2 As System.Windows.Forms.Label
Public WithEvents Label1 As System.Windows.Forms.Label
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Public WithEvents cmdSubmit As System.Windows.Forms.Button
Public WithEvents txtSubmit As System.Windows.Forms.TextBox
Public WithEvents chkUseAuthentication As System.Windows.Forms.CheckBox
Public WithEvents txtPassword As System.Windows.Forms.TextBox
Public WithEvents txtNPI As System.Windows.Forms.TextBox
Public WithEvents txtTON As System.Windows.Forms.TextBox
Public WithEvents txtAccount As System.Windows.Forms.TextBox
Public WithEvents Label8 As System.Windows.Forms.Label
Public WithEvents Label5 As System.Windows.Forms.Label
Public WithEvents Label4 As System.Windows.Forms.Label
Public WithEvents label10 As System.Windows.Forms.Label
Friend WithEvents SMSCclientUCP As SMSCclientUCP
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.chkDirectDisplay = New System.Windows.Forms.CheckBox
Me.chkStatusReport = New System.Windows.Forms.CheckBox
Me.txtUDH = New System.Windows.Forms.TextBox
Me.cbEncoding = New System.Windows.Forms.ComboBox
Me.txtOriginator = New System.Windows.Forms.TextBox
Me.cmdInitialize = New System.Windows.Forms.Button
Me.txtDestination = New System.Windows.Forms.TextBox
Me.txtLog = New System.Windows.Forms.TextBox
Me.cmdSubmit = New System.Windows.Forms.Button
Me.txtSubmit = New System.Windows.Forms.TextBox
Me.cmdDisconnect = New System.Windows.Forms.Button
Me.txtPort = New System.Windows.Forms.TextBox
Me.txtHost = New System.Windows.Forms.TextBox
Me.cmdConnect = New System.Windows.Forms.Button
Me.Label17 = New System.Windows.Forms.Label
Me.Line3 = New System.Windows.Forms.Label
Me.Label16 = New System.Windows.Forms.Label
Me.Line2 = New System.Windows.Forms.Label
Me.Line1 = New System.Windows.Forms.Label
Me.Label9 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label7 = New System.Windows.Forms.Label
Me.Label6 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.chkUseAuthentication = New System.Windows.Forms.CheckBox
Me.txtPassword = New System.Windows.Forms.TextBox
Me.txtNPI = New System.Windows.Forms.TextBox
Me.txtTON = New System.Windows.Forms.TextBox
Me.txtAccount = New System.Windows.Forms.TextBox
Me.Label8 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.label10 = New System.Windows.Forms.Label
Me.SMSCclientUCP = New smscc.UCP.SMSCclientUCP
Me.SuspendLayout()
'
'chkDirectDisplay
'
Me.chkDirectDisplay.BackColor = System.Drawing.SystemColors.Control
Me.chkDirectDisplay.Cursor = System.Windows.Forms.Cursors.Default
Me.chkDirectDisplay.ForeColor = System.Drawing.SystemColors.ControlText
Me.chkDirectDisplay.Location = New System.Drawing.Point(100, 364)
Me.chkDirectDisplay.Name = "chkDirectDisplay"
Me.chkDirectDisplay.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.chkDirectDisplay.Size = New System.Drawing.Size(201, 17)
Me.chkDirectDisplay.TabIndex = 17
Me.chkDirectDisplay.Text = "Direct display (Flash SMS)"
Me.chkDirectDisplay.TextAlign = System.Drawing.ContentAlignment.BottomLeft
Me.chkDirectDisplay.UseVisualStyleBackColor = False
'
'chkStatusReport
'
Me.chkStatusReport.BackColor = System.Drawing.SystemColors.Control
Me.chkStatusReport.Checked = True
Me.chkStatusReport.CheckState = System.Windows.Forms.CheckState.Checked
Me.chkStatusReport.Cursor = System.Windows.Forms.Cursors.Default
Me.chkStatusReport.ForeColor = System.Drawing.SystemColors.ControlText
Me.chkStatusReport.Location = New System.Drawing.Point(100, 348)
Me.chkStatusReport.Name = "chkStatusReport"
Me.chkStatusReport.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.chkStatusReport.Size = New System.Drawing.Size(220, 17)
Me.chkStatusReport.TabIndex = 16
Me.chkStatusReport.Text = "Request status report for the message"
Me.chkStatusReport.TextAlign = System.Drawing.ContentAlignment.BottomLeft
Me.chkStatusReport.UseVisualStyleBackColor = False
'
'txtUDH
'
Me.txtUDH.AcceptsReturn = True
Me.txtUDH.BackColor = System.Drawing.SystemColors.Window
Me.txtUDH.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtUDH.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtUDH.Location = New System.Drawing.Point(100, 280)
Me.txtUDH.MaxLength = 0
Me.txtUDH.Multiline = True
Me.txtUDH.Name = "txtUDH"
Me.txtUDH.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtUDH.Size = New System.Drawing.Size(201, 33)
Me.txtUDH.TabIndex = 14
'
'cbEncoding
'
Me.cbEncoding.BackColor = System.Drawing.SystemColors.Window
Me.cbEncoding.Cursor = System.Windows.Forms.Cursors.Default
Me.cbEncoding.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cbEncoding.ForeColor = System.Drawing.SystemColors.WindowText
Me.cbEncoding.Items.AddRange(New Object() {"7 bit encoded text", "8 bit encoded data", "UCS2 encoded text"})
Me.cbEncoding.Location = New System.Drawing.Point(100, 316)
Me.cbEncoding.Name = "cbEncoding"
Me.cbEncoding.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.cbEncoding.Size = New System.Drawing.Size(201, 21)
Me.cbEncoding.TabIndex = 15
'
'txtOriginator
'
Me.txtOriginator.AcceptsReturn = True
Me.txtOriginator.BackColor = System.Drawing.SystemColors.Window
Me.txtOriginator.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtOriginator.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtOriginator.Location = New System.Drawing.Point(100, 176)
Me.txtOriginator.MaxLength = 0
Me.txtOriginator.Name = "txtOriginator"
Me.txtOriginator.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtOriginator.Size = New System.Drawing.Size(201, 20)
Me.txtOriginator.TabIndex = 11
'
'cmdInitialize
'
Me.cmdInitialize.BackColor = System.Drawing.SystemColors.Control
Me.cmdInitialize.Cursor = System.Windows.Forms.Cursors.Default
Me.cmdInitialize.ForeColor = System.Drawing.SystemColors.ControlText
Me.cmdInitialize.Location = New System.Drawing.Point(320, 88)
Me.cmdInitialize.Name = "cmdInitialize"
Me.cmdInitialize.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.cmdInitialize.Size = New System.Drawing.Size(69, 23)
Me.cmdInitialize.TabIndex = 2
Me.cmdInitialize.Text = "Initialize"
Me.cmdInitialize.UseVisualStyleBackColor = False
'
'txtDestination
'
Me.txtDestination.AcceptsReturn = True
Me.txtDestination.BackColor = System.Drawing.SystemColors.Window
Me.txtDestination.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtDestination.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtDestination.Location = New System.Drawing.Point(100, 200)
Me.txtDestination.MaxLength = 0
Me.txtDestination.Name = "txtDestination"
Me.txtDestination.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtDestination.Size = New System.Drawing.Size(201, 20)
Me.txtDestination.TabIndex = 12
'
'txtLog
'
Me.txtLog.AcceptsReturn = True
Me.txtLog.BackColor = System.Drawing.SystemColors.Window
Me.txtLog.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtLog.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtLog.Location = New System.Drawing.Point(20, 412)
Me.txtLog.MaxLength = 0
Me.txtLog.Multiline = True
Me.txtLog.Name = "txtLog"
Me.txtLog.ReadOnly = True
Me.txtLog.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.txtLog.Size = New System.Drawing.Size(373, 101)
Me.txtLog.TabIndex = 18
Me.txtLog.WordWrap = False
'
'cmdSubmit
'
Me.cmdSubmit.BackColor = System.Drawing.SystemColors.Control
Me.cmdSubmit.Cursor = System.Windows.Forms.Cursors.Default
Me.cmdSubmit.ForeColor = System.Drawing.SystemColors.ControlText
Me.cmdSubmit.Location = New System.Drawing.Point(320, 176)
Me.cmdSubmit.Name = "cmdSubmit"
Me.cmdSubmit.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.cmdSubmit.Size = New System.Drawing.Size(69, 23)
Me.cmdSubmit.TabIndex = 3
Me.cmdSubmit.Text = "Submit"
Me.cmdSubmit.UseVisualStyleBackColor = False
'
'txtSubmit
'
Me.txtSubmit.AcceptsReturn = True
Me.txtSubmit.BackColor = System.Drawing.SystemColors.Window
Me.txtSubmit.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtSubmit.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtSubmit.Location = New System.Drawing.Point(100, 224)
Me.txtSubmit.MaxLength = 0
Me.txtSubmit.Multiline = True
Me.txtSubmit.Name = "txtSubmit"
Me.txtSubmit.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtSubmit.Size = New System.Drawing.Size(201, 53)
Me.txtSubmit.TabIndex = 13
'
'cmdDisconnect
'
Me.cmdDisconnect.BackColor = System.Drawing.SystemColors.Control
Me.cmdDisconnect.Cursor = System.Windows.Forms.Cursors.Default
Me.cmdDisconnect.ForeColor = System.Drawing.SystemColors.ControlText
Me.cmdDisconnect.Location = New System.Drawing.Point(320, 44)
Me.cmdDisconnect.Name = "cmdDisconnect"
Me.cmdDisconnect.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.cmdDisconnect.Size = New System.Drawing.Size(69, 23)
Me.cmdDisconnect.TabIndex = 1
Me.cmdDisconnect.Text = "Disconnect"
Me.cmdDisconnect.UseVisualStyleBackColor = False
'
'txtPort
'
Me.txtPort.AcceptsReturn = True
Me.txtPort.BackColor = System.Drawing.SystemColors.Window
Me.txtPort.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtPort.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtPort.Location = New System.Drawing.Point(260, 12)
Me.txtPort.MaxLength = 0
Me.txtPort.Name = "txtPort"
Me.txtPort.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtPort.Size = New System.Drawing.Size(41, 20)
Me.txtPort.TabIndex = 5
Me.txtPort.Text = "0"
'
'txtHost
'
Me.txtHost.AcceptsReturn = True
Me.txtHost.BackColor = System.Drawing.SystemColors.Window
Me.txtHost.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtHost.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtHost.Location = New System.Drawing.Point(100, 12)
Me.txtHost.MaxLength = 0
Me.txtHost.Name = "txtHost"
Me.txtHost.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtHost.Size = New System.Drawing.Size(117, 20)
Me.txtHost.TabIndex = 4
Me.txtHost.Text = "0.0.0.0"
'
'cmdConnect
'
Me.cmdConnect.BackColor = System.Drawing.SystemColors.Control
Me.cmdConnect.Cursor = System.Windows.Forms.Cursors.Default
Me.cmdConnect.ForeColor = System.Drawing.SystemColors.ControlText
Me.cmdConnect.Location = New System.Drawing.Point(320, 12)
Me.cmdConnect.Name = "cmdConnect"
Me.cmdConnect.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.cmdConnect.Size = New System.Drawing.Size(69, 23)
Me.cmdConnect.TabIndex = 0
Me.cmdConnect.Text = "Connect"
Me.cmdConnect.UseVisualStyleBackColor = False
'
'Label17
'
Me.Label17.AutoSize = True
Me.Label17.BackColor = System.Drawing.SystemColors.Control
Me.Label17.Cursor = System.Windows.Forms.Cursors.Default
Me.Label17.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label17.Location = New System.Drawing.Point(20, 396)
Me.Label17.Name = "Label17"
Me.Label17.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label17.Size = New System.Drawing.Size(55, 13)
Me.Label17.TabIndex = 21
Me.Label17.Text = "Event log:"
'
'Line3
'
Me.Line3.BackColor = System.Drawing.SystemColors.AppWorkspace
Me.Line3.Location = New System.Drawing.Point(16, 388)
Me.Line3.Name = "Line3"
Me.Line3.Size = New System.Drawing.Size(380, 1)
Me.Line3.TabIndex = 22
'
'Label16
'
Me.Label16.BackColor = System.Drawing.SystemColors.Control
Me.Label16.Cursor = System.Windows.Forms.Cursors.Default
Me.Label16.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label16.Location = New System.Drawing.Point(20, 280)
Me.Label16.Name = "Label16"
Me.Label16.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label16.Size = New System.Drawing.Size(57, 29)
Me.Label16.TabIndex = 20
Me.Label16.Text = "User Data Header:"
'
'Line2
'
Me.Line2.BackColor = System.Drawing.SystemColors.AppWorkspace
Me.Line2.Location = New System.Drawing.Point(16, 164)
Me.Line2.Name = "Line2"
Me.Line2.Size = New System.Drawing.Size(380, 1)
Me.Line2.TabIndex = 23
'
'Line1
'
Me.Line1.BackColor = System.Drawing.SystemColors.AppWorkspace
Me.Line1.Location = New System.Drawing.Point(16, 76)
Me.Line1.Name = "Line1"
Me.Line1.Size = New System.Drawing.Size(380, 1)
Me.Line1.TabIndex = 24
'
'Label9
'
Me.Label9.AutoSize = True
Me.Label9.BackColor = System.Drawing.SystemColors.Control
Me.Label9.Cursor = System.Windows.Forms.Cursors.Default
Me.Label9.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label9.Location = New System.Drawing.Point(20, 320)
Me.Label9.Name = "Label9"
Me.Label9.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label9.Size = New System.Drawing.Size(55, 13)
Me.Label9.TabIndex = 19
Me.Label9.Text = "Encoding:"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.BackColor = System.Drawing.SystemColors.Control
Me.Label3.Cursor = System.Windows.Forms.Cursors.Default
Me.Label3.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label3.Location = New System.Drawing.Point(20, 180)
Me.Label3.Name = "Label3"
Me.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label3.Size = New System.Drawing.Size(55, 13)
Me.Label3.TabIndex = 18
Me.Label3.Text = "Originator:"
'
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.BackColor = System.Drawing.SystemColors.Control
Me.Label7.Cursor = System.Windows.Forms.Cursors.Default
Me.Label7.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label7.Location = New System.Drawing.Point(20, 228)
Me.Label7.Name = "Label7"
Me.Label7.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label7.Size = New System.Drawing.Size(53, 13)
Me.Label7.TabIndex = 17
Me.Label7.Text = "Message:"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.BackColor = System.Drawing.SystemColors.Control
Me.Label6.Cursor = System.Windows.Forms.Cursors.Default
Me.Label6.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label6.Location = New System.Drawing.Point(20, 204)
Me.Label6.Name = "Label6"
Me.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label6.Size = New System.Drawing.Size(63, 13)
Me.Label6.TabIndex = 16
Me.Label6.Text = "Destination:"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.BackColor = System.Drawing.SystemColors.Control
Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
Me.Label2.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label2.Location = New System.Drawing.Point(224, 16)
Me.Label2.Name = "Label2"
Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label2.Size = New System.Drawing.Size(29, 13)
Me.Label2.TabIndex = 15
Me.Label2.Text = "Port:"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.BackColor = System.Drawing.SystemColors.Control
Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
Me.Label1.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label1.Location = New System.Drawing.Point(20, 16)
Me.Label1.Name = "Label1"
Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label1.Size = New System.Drawing.Size(80, 13)
Me.Label1.TabIndex = 14
Me.Label1.Text = "SMSC address:"
'
'chkUseAuthentication
'
Me.chkUseAuthentication.BackColor = System.Drawing.SystemColors.Control
Me.chkUseAuthentication.Cursor = System.Windows.Forms.Cursors.Default
Me.chkUseAuthentication.ForeColor = System.Drawing.SystemColors.ControlText
Me.chkUseAuthentication.Location = New System.Drawing.Point(100, 136)
Me.chkUseAuthentication.Name = "chkUseAuthentication"
Me.chkUseAuthentication.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.chkUseAuthentication.Size = New System.Drawing.Size(216, 17)
Me.chkUseAuthentication.TabIndex = 10
Me.chkUseAuthentication.Text = "Use Authentication (OT-60 operation)"
Me.chkUseAuthentication.TextAlign = System.Drawing.ContentAlignment.BottomLeft
Me.chkUseAuthentication.UseVisualStyleBackColor = False
'
'txtPassword
'
Me.txtPassword.AcceptsReturn = True
Me.txtPassword.BackColor = System.Drawing.SystemColors.Window
Me.txtPassword.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtPassword.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtPassword.Location = New System.Drawing.Point(100, 112)
Me.txtPassword.MaxLength = 0
Me.txtPassword.Name = "txtPassword"
Me.txtPassword.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
Me.txtPassword.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtPassword.Size = New System.Drawing.Size(117, 20)
Me.txtPassword.TabIndex = 8
'
'txtNPI
'
Me.txtNPI.AcceptsReturn = True
Me.txtNPI.BackColor = System.Drawing.SystemColors.Window
Me.txtNPI.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtNPI.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtNPI.Location = New System.Drawing.Point(260, 112)
Me.txtNPI.MaxLength = 0
Me.txtNPI.Name = "txtNPI"
Me.txtNPI.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtNPI.Size = New System.Drawing.Size(41, 20)
Me.txtNPI.TabIndex = 9
Me.txtNPI.Text = "1"
'
'txtTON
'
Me.txtTON.AcceptsReturn = True
Me.txtTON.BackColor = System.Drawing.SystemColors.Window
Me.txtTON.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtTON.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtTON.Location = New System.Drawing.Point(260, 88)
Me.txtTON.MaxLength = 0
Me.txtTON.Name = "txtTON"
Me.txtTON.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtTON.Size = New System.Drawing.Size(41, 20)
Me.txtTON.TabIndex = 7
Me.txtTON.Text = "1"
'
'txtAccount
'
Me.txtAccount.AcceptsReturn = True
Me.txtAccount.BackColor = System.Drawing.SystemColors.Window
Me.txtAccount.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtAccount.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtAccount.Location = New System.Drawing.Point(100, 88)
Me.txtAccount.MaxLength = 0
Me.txtAccount.Name = "txtAccount"
Me.txtAccount.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtAccount.Size = New System.Drawing.Size(117, 20)
Me.txtAccount.TabIndex = 6
'
'Label8
'
Me.Label8.AutoSize = True
Me.Label8.BackColor = System.Drawing.SystemColors.Control
Me.Label8.Cursor = System.Windows.Forms.Cursors.Default
Me.Label8.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label8.Location = New System.Drawing.Point(20, 116)
Me.Label8.Name = "Label8"
Me.Label8.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label8.Size = New System.Drawing.Size(56, 13)
Me.Label8.TabIndex = 92
Me.Label8.Text = "Password:"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.BackColor = System.Drawing.SystemColors.Control
Me.Label5.Cursor = System.Windows.Forms.Cursors.Default
Me.Label5.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label5.Location = New System.Drawing.Point(224, 116)
Me.Label5.Name = "Label5"
Me.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label5.Size = New System.Drawing.Size(28, 13)
Me.Label5.TabIndex = 91
Me.Label5.Text = "NPI:"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.BackColor = System.Drawing.SystemColors.Control
Me.Label4.Cursor = System.Windows.Forms.Cursors.Default
Me.Label4.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label4.Location = New System.Drawing.Point(224, 92)
Me.Label4.Name = "Label4"
Me.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label4.Size = New System.Drawing.Size(33, 13)
Me.Label4.TabIndex = 90
Me.Label4.Text = "TON:"
'
'label10
'
Me.label10.AutoSize = True
Me.label10.BackColor = System.Drawing.SystemColors.Control
Me.label10.Cursor = System.Windows.Forms.Cursors.Default
Me.label10.ForeColor = System.Drawing.SystemColors.ControlText
Me.label10.Location = New System.Drawing.Point(20, 92)
Me.label10.Name = "label10"
Me.label10.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.label10.Size = New System.Drawing.Size(50, 13)
Me.label10.TabIndex = 89
Me.label10.Text = "Account:"
Me.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'SMSCclientUCP
'
Me.SMSCclientUCP.ImmediateResponse = False
Me.SMSCclientUCP.KeepAliveInterval = 10
Me.SMSCclientUCP.KeepAliveOperation = smscc.UCP.ucpKeepAliveOperationEnum.aoSMTAlert
Me.SMSCclientUCP.ResponseTimeOut = 10
Me.SMSCclientUCP.ThrottleRate = 0
'
'fmMain
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(414, 533)
Me.Controls.Add(Me.chkUseAuthentication)
Me.Controls.Add(Me.txtPassword)
Me.Controls.Add(Me.txtNPI)
Me.Controls.Add(Me.txtTON)
Me.Controls.Add(Me.txtAccount)
Me.Controls.Add(Me.Label8)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.label10)
Me.Controls.Add(Me.chkStatusReport)
Me.Controls.Add(Me.txtUDH)
Me.Controls.Add(Me.cbEncoding)
Me.Controls.Add(Me.txtOriginator)
Me.Controls.Add(Me.cmdInitialize)
Me.Controls.Add(Me.txtDestination)
Me.Controls.Add(Me.txtLog)
Me.Controls.Add(Me.cmdSubmit)
Me.Controls.Add(Me.txtSubmit)
Me.Controls.Add(Me.cmdDisconnect)
Me.Controls.Add(Me.txtPort)
Me.Controls.Add(Me.txtHost)
Me.Controls.Add(Me.cmdConnect)
Me.Controls.Add(Me.Label17)
Me.Controls.Add(Me.Line3)
Me.Controls.Add(Me.Label16)
Me.Controls.Add(Me.Line2)
Me.Controls.Add(Me.Line1)
Me.Controls.Add(Me.Label9)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.chkDirectDisplay)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "fmMain"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "SMSC client .NET UCP sample"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
#End Region
Private Log As EventLog
' Connect to SMSC
Private Sub cmdConnect_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdConnect.Click
Dim Result As Integer
txtLog.Text = ""
txtLog.Refresh()
Result = SMSCclientUCP.tcpConnect(txtHost.Text, CInt(txtPort.Text), "")
If Result <> 0 Then
Log.AddConnectionErrorEvent(Result)
Else
Log.AddConnectedEvent()
End If
End Sub
' Disonnect from SMSC
Private Sub cmdDisconnect_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdDisconnect.Click
SMSCclientUCP.tcpDisconnect()
End Sub
' Initialize session with SMSC
Private Sub cmdInitialize_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdInitialize.Click
Dim Result As Integer
Result = SMSCclientUCP.ucpInitializeSession(txtAccount.Text, CByte(txtTON.Text), CByte(txtNPI.Text), txtPassword.Text, chkUseAuthentication.Checked, "")
If Result <> 0 Then
Log.AddInitializationErrorEvent(Result)
Else
Log.AddInitializedEvent()
End If
End Sub
' Submit message to the SMSC
Private Sub cmdSubmit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdSubmit.Click
Dim Result As Integer
Dim SystemMessage As String
Dim TimeStamp As Date
Dim Encoding As EncodingEnum
Dim Options As Integer
SystemMessage = ""
Select Case cbEncoding.SelectedIndex
Case 2
Encoding = EncodingEnum.etUCS2Text
Case 1
Encoding = EncodingEnum.et8BitHexadecimal
Case Else
Encoding = EncodingEnum.et7BitText
End Select
Options = 0
If chkStatusReport.CheckState = CheckState.Checked Then Options = Options Or SubmitOptionEnum.soRequestStatusReport
If chkDirectDisplay.CheckState = CheckState.Checked Then Options = Options Or SubmitOptionEnum.soDirectDisplay
Result = SMSCclientUCP.ucpSubmitMessage(txtDestination.Text, txtOriginator.Text, txtSubmit.Text, Encoding, txtUDH.Text, Options, SystemMessage, TimeStamp)
If Result <> 0 Then
Log.AddMessageSubmissionErrorEvent(Result)
Else
Log.AddMessageSubmitedEvent(TimeStamp)
End If
End Sub
Private Sub fmMain_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
Log = New EventLog(txtLog)
cbEncoding.SelectedIndex = 0
End Sub
' Disconnected from SMSC
Private Sub SMSCRelayUCP_OnTcpDisconnected(ByVal sender As Object, ByVal e As tcpDisconnectedEventArgs) Handles SMSCclientUCP.OnTcpDisconnected
Log.AddDisconnectedEvent(e.Reason)
End Sub
' Message received from SMSC
Private Sub SMSCRelayUCP_OnUcpMessageReceived(ByVal Sender As Object, ByVal e As ucpMessageReceivedEventArgs) Handles SMSCclientUCP.OnUcpMessageReceived
Log.AddMessageReceivedEvent(e.Destination, e.Originator, e.Content, e.Encoding, e.UserDataHeader, e.TimeStamp)
End Sub
' Status Report (SR) received from SMSC
Private Sub SMSCRelayUCP_OnUcpStatusReportReceived(ByVal Sender As Object, ByVal e As ucpStatusReportReceivedEventArgs) Handles SMSCclientUCP.OnUcpStatusReportReceived
Log.AddStatusReportReceivedEvent(e.MessageTimeStamp, e.Destination, e.Originator, e.DeliveryStatus, e.ReasonCode, e.TimeStamp)
End Sub
End Class