| 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 : /Program Files/SMSC client .NET/samples/vb-6.0/CIMD2/ |
Upload File : |
VERSION 5.00
Begin VB.Form fmMain
BorderStyle = 3 'Fixed Dialog
Caption = "SMSC client .NET CIMD2 sample"
ClientHeight = 7815
ClientLeft = 45
ClientTop = 330
ClientWidth = 6150
Icon = "Main.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7815
ScaleWidth = 6150
StartUpPosition = 2 'CenterScreen
Begin VB.CheckBox chkDirectDisplay
Caption = "Direct display (Flash SMS)"
Height = 255
Left = 1500
TabIndex = 14
Top = 5280
Width = 3015
End
Begin VB.CheckBox chkStatusReport
Caption = "Request status report for the message"
Height = 255
Left = 1500
TabIndex = 13
Top = 5040
Value = 1 'Checked
Width = 3015
End
Begin VB.TextBox txtUDH
Height = 495
Left = 1500
MultiLine = -1 'True
TabIndex = 11
Top = 3960
Width = 3015
End
Begin VB.ComboBox cbEncoding
Height = 315
ItemData = "Main.frx":000C
Left = 1500
List = "Main.frx":0019
Style = 2 'Dropdown List
TabIndex = 12
Top = 4500
Width = 3015
End
Begin VB.TextBox txtOriginator
Height = 315
Left = 1500
TabIndex = 8
Top = 2400
Width = 3015
End
Begin VB.TextBox txtPassword
Height = 315
IMEMode = 3 'DISABLE
Left = 1500
PasswordChar = "*"
TabIndex = 7
Top = 1740
Width = 3015
End
Begin VB.CommandButton cmdInitialize
Caption = "Initialize"
Height = 345
Left = 4800
TabIndex = 2
Top = 1380
Width = 1035
End
Begin VB.TextBox txtUserID
Height = 315
Left = 1500
TabIndex = 6
Top = 1380
Width = 3015
End
Begin VB.TextBox txtDestination
Height = 315
Left = 1500
TabIndex = 9
Top = 2760
Width = 3015
End
Begin VB.TextBox txtLog
Height = 1515
Left = 300
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 15
Top = 6000
Width = 5595
End
Begin VB.CommandButton cmdSubmit
Caption = "Submit"
Height = 345
Left = 4800
TabIndex = 3
Top = 2400
Width = 1035
End
Begin VB.TextBox txtSubmit
Height = 795
Left = 1500
MultiLine = -1 'True
TabIndex = 10
Top = 3120
Width = 3015
End
Begin VB.CommandButton cmdDisconnect
Caption = "Disconnect"
Height = 345
Left = 4800
TabIndex = 1
Top = 720
Width = 1035
End
Begin VB.TextBox txtPort
Height = 315
Left = 3900
TabIndex = 5
Text = "0"
Top = 240
Width = 615
End
Begin VB.TextBox txtHost
Height = 315
Left = 1500
TabIndex = 4
Text = "0.0.0.0"
Top = 240
Width = 1755
End
Begin VB.CommandButton cmdConnect
Caption = "Connect"
Height = 345
Left = 4800
TabIndex = 0
Top = 240
Width = 1035
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "Event log:"
Height = 195
Left = 300
TabIndex = 25
Top = 5760
Width = 720
End
Begin VB.Line Line1
BorderColor = &H8000000C&
X1 = 240
X2 = 5940
Y1 = 5640
Y2 = 5640
End
Begin VB.Line Line4
BorderColor = &H8000000C&
X1 = 240
X2 = 5940
Y1 = 2220
Y2 = 2220
End
Begin VB.Line Line2
BorderColor = &H8000000C&
X1 = 240
X2 = 5940
Y1 = 1200
Y2 = 1200
End
Begin VB.Label Label8
Caption = "User Data Header:"
Height = 435
Left = 300
TabIndex = 24
Top = 3960
Width = 855
WordWrap = -1 'True
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "Encoding:"
Height = 195
Left = 300
TabIndex = 23
Top = 4560
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "Originator:"
Height = 195
Left = 300
TabIndex = 22
Top = 2460
Width = 795
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "Password:"
Height = 195
Left = 300
TabIndex = 21
Top = 1800
Width = 735
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "Message:"
Height = 195
Left = 300
TabIndex = 20
Top = 3240
Width = 735
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "Destination:"
Height = 195
Left = 300
TabIndex = 19
Top = 2820
Width = 855
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "User ID:"
Height = 195
Left = 300
TabIndex = 18
Top = 1440
Width = 615
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "Port:"
Height = 195
Left = 3360
TabIndex = 17
Top = 300
Width = 375
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "SMSC address:"
Height = 195
Left = 300
TabIndex = 16
Top = 300
Width = 1095
End
End
Attribute VB_Name = "fmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'------------------------------------------------------------------------------
' SMSC client .NET components CIMD2 sample application of COM interface
'
' $Header: $
' Copyright (c) 2003-2013 Tops. All rights reserved.
'------------------------------------------------------------------------------
Private WithEvents cimd2 As SMSCclientCIMD2
Attribute cimd2.VB_VarHelpID = -1
Option Explicit
' Connect to SMSC
Private Sub cmdConnect_Click()
Dim Result As Long
txtLog = ""
AddConnectingEvent txtLog
txtLog.Refresh
Result = cimd2.tcpConnect(txtHost, txtPort)
If Result <> 0 Then
AddConnectionErrorEvent txtLog, Result
Else
AddConnectedEvent txtLog
End If
End Sub
' Disonnect from SMSC
Private Sub cmdDisconnect_Click()
cimd2.tcpDisconnect
End Sub
' Initialize session with SMSC
Private Sub cmdInitialize_Click()
Dim Result As Long
Result = cimd2.cimd2InitializeSession(txtUserID, txtPassword)
If Result <> 0 Then
AddInitializationErrorEvent txtLog, Result
Else
AddInitializedEvent txtLog
End If
End Sub
' Submit message to the SMSC
Private Sub cmdSubmit_Click()
Dim Result As Long
Dim TimeStamp As Date
Dim Encoding As EncodingEnum
Dim Options As Long
Select Case cbEncoding.ListIndex
Case 2
Encoding = EncodingEnum_etUCS2Text
Case 1
Encoding = EncodingEnum_et8BitHexadecimal
Case Else
Encoding = EncodingEnum_et7BitText
End Select
If Encoding = EncodingEnum_etUCS2Text Then
If MsgBox("Because of the nature of the VB controls, which do not " & _
"support UNICODE the message will only be sent correctly if the " & _
"characters entered in the Message box match the default code page. " & _
vbCrLf & vbCrLf & "Do you want to continue?", vbQuestion + vbYesNo) <> vbYes Then
Exit Sub
End If
End If
Options = 0
If chkStatusReport.Value = vbChecked Then _
Options = Options Or SubmitOptionEnum_soRequestStatusReport
If chkDirectDisplay.Value = vbChecked Then _
Options = Options Or SubmitOptionEnum_soDirectDisplay
Result = cimd2.cimd2SubmitMessage(txtDestination, txtOriginator, txtSubmit, Encoding, txtUDH, Options, "", TimeStamp)
If Result <> 0 Then
AddMessageSubmissionErrorEvent txtLog, Result
Else
AddMessageSubmitedEvent txtLog, , TimeStamp
End If
End Sub
Private Sub Form_Load()
Set cimd2 = New SMSCclientCIMD2
cbEncoding.ListIndex = 0
End Sub
' Disconnected from SMSC
Private Sub cimd2_OnTcpDisconnected(ByVal sender As Variant, ByVal e As smscc.ITcpDisconnectedEventArgs)
AddDisconnectedEvent txtLog, e.Reason
End Sub
' Message received from SMSC
Private Sub cimd2_OnCimd2MessageReceived(ByVal sender As Variant, ByVal e As smscc.ICimd2MessageReceivedEventArgs)
AddMessageReceivedEvent txtLog, e.Destination, e.Originator, e.Content, e.Encoding, e.UserDataHeader, e.TimeStamp
End Sub
' Status Report (SR) received from SMSC
Private Sub cimd2_OnCimd2StatusReportReceived(ByVal sender As Variant, ByVal e As smscc.ICimd2StatusReportReceivedEventArgs)
AddStatusReportReceivedEvent txtLog, e.Destination, e.StatusCode, e.StatusErrorCode, e.MessageTimeStamp, e.TimeStamp
End Sub