403Webshell
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/cs-net/UCP/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Program Files/SMSC client .NET/samples/cs-net/UCP/Main.cs
//------------------------------------------------------------------------------
// SMSC Relay components UCP sample application
//
// $Header: $
// Copyright (c) 2003-2013 Tops. All rights reserved.
//------------------------------------------------------------------------------

using System;
using System.Windows.Forms;
using smscc;
using smscc.UCP;

namespace sampleUCP
{
	public class fmMain : System.Windows.Forms.Form
	{
		public System.Windows.Forms.CheckBox chkStatusReport;
		public System.Windows.Forms.TextBox txtUDH;
		public System.Windows.Forms.ComboBox cbEncoding;
		public System.Windows.Forms.TextBox txtOriginator;
		public System.Windows.Forms.Button cmdInitialize;
		public System.Windows.Forms.TextBox txtDestination;
		public System.Windows.Forms.TextBox txtLog;
		public System.Windows.Forms.Button cmdSubmit;
		public System.Windows.Forms.Button cmdDisconnect;
		public System.Windows.Forms.TextBox txtPort;
		public System.Windows.Forms.TextBox txtHost;
        public System.Windows.Forms.Button cmdConnect;
		public System.Windows.Forms.Label Label17;
		public System.Windows.Forms.Label Line3;
		public System.Windows.Forms.Label Label16;
		public System.Windows.Forms.Label Line2;
		public System.Windows.Forms.Label Line1;
		public System.Windows.Forms.Label Label9;
		public System.Windows.Forms.Label Label3;
		public System.Windows.Forms.Label Label7;
		public System.Windows.Forms.Label Label6;
		public System.Windows.Forms.Label Label2;
		public System.Windows.Forms.Label Label1;
		public System.Windows.Forms.CheckBox chkDirectDisplay;
        public System.Windows.Forms.TextBox txtSubmit;
        public System.Windows.Forms.TextBox txtPassword;
        public System.Windows.Forms.TextBox txtNPI;
        public System.Windows.Forms.TextBox txtTON;
        public System.Windows.Forms.TextBox txtAccount;
        public System.Windows.Forms.Label Label8;
        public System.Windows.Forms.Label Label5;
        public System.Windows.Forms.Label Label4;
        public System.Windows.Forms.Label label10;
        public System.Windows.Forms.CheckBox chkUseAuthentication;
		private SMSCclientUCP SMSCclientUCP;
		private System.ComponentModel.Container components = null;

		public fmMain()
		{
			InitializeComponent();
		}

		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.chkStatusReport = new System.Windows.Forms.CheckBox();
            this.txtUDH = new System.Windows.Forms.TextBox();
            this.cbEncoding = new System.Windows.Forms.ComboBox();
            this.txtOriginator = new System.Windows.Forms.TextBox();
            this.cmdInitialize = new System.Windows.Forms.Button();
            this.txtDestination = new System.Windows.Forms.TextBox();
            this.txtLog = new System.Windows.Forms.TextBox();
            this.cmdSubmit = new System.Windows.Forms.Button();
            this.txtSubmit = new System.Windows.Forms.TextBox();
            this.cmdDisconnect = new System.Windows.Forms.Button();
            this.txtPort = new System.Windows.Forms.TextBox();
            this.txtHost = new System.Windows.Forms.TextBox();
            this.cmdConnect = new System.Windows.Forms.Button();
            this.Label17 = new System.Windows.Forms.Label();
            this.Line3 = new System.Windows.Forms.Label();
            this.Label16 = new System.Windows.Forms.Label();
            this.Line2 = new System.Windows.Forms.Label();
            this.Line1 = new System.Windows.Forms.Label();
            this.Label9 = new System.Windows.Forms.Label();
            this.Label3 = new System.Windows.Forms.Label();
            this.Label7 = new System.Windows.Forms.Label();
            this.Label6 = new System.Windows.Forms.Label();
            this.Label2 = new System.Windows.Forms.Label();
            this.Label1 = new System.Windows.Forms.Label();
            this.chkDirectDisplay = new System.Windows.Forms.CheckBox();
            this.txtPassword = new System.Windows.Forms.TextBox();
            this.txtNPI = new System.Windows.Forms.TextBox();
            this.txtTON = new System.Windows.Forms.TextBox();
            this.txtAccount = new System.Windows.Forms.TextBox();
            this.Label8 = new System.Windows.Forms.Label();
            this.Label5 = new System.Windows.Forms.Label();
            this.Label4 = new System.Windows.Forms.Label();
            this.label10 = new System.Windows.Forms.Label();
            this.chkUseAuthentication = new System.Windows.Forms.CheckBox();
            this.SMSCclientUCP = new smscc.UCP.SMSCclientUCP();
            this.SuspendLayout();
            // 
            // chkStatusReport
            // 
            this.chkStatusReport.BackColor = System.Drawing.SystemColors.Control;
            this.chkStatusReport.Checked = true;
            this.chkStatusReport.CheckState = System.Windows.Forms.CheckState.Checked;
            this.chkStatusReport.Cursor = System.Windows.Forms.Cursors.Default;
            this.chkStatusReport.ForeColor = System.Drawing.SystemColors.ControlText;
            this.chkStatusReport.Location = new System.Drawing.Point(100, 348);
            this.chkStatusReport.Name = "chkStatusReport";
            this.chkStatusReport.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.chkStatusReport.Size = new System.Drawing.Size(216, 17);
            this.chkStatusReport.TabIndex = 16;
            this.chkStatusReport.Text = "Request status report for the message";
            this.chkStatusReport.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
            this.chkStatusReport.UseVisualStyleBackColor = false;
            // 
            // txtUDH
            // 
            this.txtUDH.AcceptsReturn = true;
            this.txtUDH.BackColor = System.Drawing.SystemColors.Window;
            this.txtUDH.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtUDH.ForeColor = System.Drawing.SystemColors.WindowText;
            this.txtUDH.Location = new System.Drawing.Point(100, 280);
            this.txtUDH.MaxLength = 0;
            this.txtUDH.Multiline = true;
            this.txtUDH.Name = "txtUDH";
            this.txtUDH.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.txtUDH.Size = new System.Drawing.Size(201, 33);
            this.txtUDH.TabIndex = 14;
            // 
            // cbEncoding
            // 
            this.cbEncoding.BackColor = System.Drawing.SystemColors.Window;
            this.cbEncoding.Cursor = System.Windows.Forms.Cursors.Default;
            this.cbEncoding.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbEncoding.ForeColor = System.Drawing.SystemColors.WindowText;
            this.cbEncoding.Items.AddRange(new object[] {
            "7 bit encoded text",
            "8 bit encoded data",
            "UCS2 encoded text"});
            this.cbEncoding.Location = new System.Drawing.Point(100, 316);
            this.cbEncoding.Name = "cbEncoding";
            this.cbEncoding.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.cbEncoding.Size = new System.Drawing.Size(201, 21);
            this.cbEncoding.TabIndex = 15;
            // 
            // txtOriginator
            // 
            this.txtOriginator.AcceptsReturn = true;
            this.txtOriginator.BackColor = System.Drawing.SystemColors.Window;
            this.txtOriginator.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtOriginator.ForeColor = System.Drawing.SystemColors.WindowText;
            this.txtOriginator.Location = new System.Drawing.Point(100, 176);
            this.txtOriginator.MaxLength = 0;
            this.txtOriginator.Name = "txtOriginator";
            this.txtOriginator.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.txtOriginator.Size = new System.Drawing.Size(201, 20);
            this.txtOriginator.TabIndex = 11;
            // 
            // cmdInitialize
            // 
            this.cmdInitialize.BackColor = System.Drawing.SystemColors.Control;
            this.cmdInitialize.Cursor = System.Windows.Forms.Cursors.Default;
            this.cmdInitialize.ForeColor = System.Drawing.SystemColors.ControlText;
            this.cmdInitialize.Location = new System.Drawing.Point(320, 88);
            this.cmdInitialize.Name = "cmdInitialize";
            this.cmdInitialize.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.cmdInitialize.Size = new System.Drawing.Size(69, 23);
            this.cmdInitialize.TabIndex = 2;
            this.cmdInitialize.Text = "Initialize";
            this.cmdInitialize.UseVisualStyleBackColor = false;
            this.cmdInitialize.Click += new System.EventHandler(this.cmdInitialize_Click);
            // 
            // txtDestination
            // 
            this.txtDestination.AcceptsReturn = true;
            this.txtDestination.BackColor = System.Drawing.SystemColors.Window;
            this.txtDestination.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtDestination.ForeColor = System.Drawing.SystemColors.WindowText;
            this.txtDestination.Location = new System.Drawing.Point(100, 200);
            this.txtDestination.MaxLength = 0;
            this.txtDestination.Name = "txtDestination";
            this.txtDestination.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.txtDestination.Size = new System.Drawing.Size(201, 20);
            this.txtDestination.TabIndex = 12;
            // 
            // txtLog
            // 
            this.txtLog.AcceptsReturn = true;
            this.txtLog.BackColor = System.Drawing.SystemColors.Window;
            this.txtLog.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtLog.ForeColor = System.Drawing.SystemColors.WindowText;
            this.txtLog.Location = new System.Drawing.Point(20, 412);
            this.txtLog.MaxLength = 0;
            this.txtLog.Multiline = true;
            this.txtLog.Name = "txtLog";
            this.txtLog.ReadOnly = true;
            this.txtLog.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.txtLog.Size = new System.Drawing.Size(373, 101);
            this.txtLog.TabIndex = 18;
            this.txtLog.WordWrap = false;
            // 
            // cmdSubmit
            // 
            this.cmdSubmit.BackColor = System.Drawing.SystemColors.Control;
            this.cmdSubmit.Cursor = System.Windows.Forms.Cursors.Default;
            this.cmdSubmit.ForeColor = System.Drawing.SystemColors.ControlText;
            this.cmdSubmit.Location = new System.Drawing.Point(320, 176);
            this.cmdSubmit.Name = "cmdSubmit";
            this.cmdSubmit.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.cmdSubmit.Size = new System.Drawing.Size(69, 23);
            this.cmdSubmit.TabIndex = 3;
            this.cmdSubmit.Text = "Submit";
            this.cmdSubmit.UseVisualStyleBackColor = false;
            this.cmdSubmit.Click += new System.EventHandler(this.cmdSubmit_Click);
            // 
            // txtSubmit
            // 
            this.txtSubmit.AcceptsReturn = true;
            this.txtSubmit.BackColor = System.Drawing.SystemColors.Window;
            this.txtSubmit.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtSubmit.ForeColor = System.Drawing.SystemColors.WindowText;
            this.txtSubmit.Location = new System.Drawing.Point(100, 224);
            this.txtSubmit.MaxLength = 0;
            this.txtSubmit.Multiline = true;
            this.txtSubmit.Name = "txtSubmit";
            this.txtSubmit.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.txtSubmit.Size = new System.Drawing.Size(201, 53);
            this.txtSubmit.TabIndex = 13;
            // 
            // cmdDisconnect
            // 
            this.cmdDisconnect.BackColor = System.Drawing.SystemColors.Control;
            this.cmdDisconnect.Cursor = System.Windows.Forms.Cursors.Default;
            this.cmdDisconnect.ForeColor = System.Drawing.SystemColors.ControlText;
            this.cmdDisconnect.Location = new System.Drawing.Point(320, 44);
            this.cmdDisconnect.Name = "cmdDisconnect";
            this.cmdDisconnect.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.cmdDisconnect.Size = new System.Drawing.Size(69, 23);
            this.cmdDisconnect.TabIndex = 1;
            this.cmdDisconnect.Text = "Disconnect";
            this.cmdDisconnect.UseVisualStyleBackColor = false;
            this.cmdDisconnect.Click += new System.EventHandler(this.cmdDisconnect_Click);
            // 
            // txtPort
            // 
            this.txtPort.AcceptsReturn = true;
            this.txtPort.BackColor = System.Drawing.SystemColors.Window;
            this.txtPort.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtPort.ForeColor = System.Drawing.SystemColors.WindowText;
            this.txtPort.Location = new System.Drawing.Point(260, 12);
            this.txtPort.MaxLength = 0;
            this.txtPort.Name = "txtPort";
            this.txtPort.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.txtPort.Size = new System.Drawing.Size(41, 20);
            this.txtPort.TabIndex = 5;
            this.txtPort.Text = "0";
            // 
            // txtHost
            // 
            this.txtHost.AcceptsReturn = true;
            this.txtHost.BackColor = System.Drawing.SystemColors.Window;
            this.txtHost.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtHost.ForeColor = System.Drawing.SystemColors.WindowText;
            this.txtHost.Location = new System.Drawing.Point(100, 12);
            this.txtHost.MaxLength = 0;
            this.txtHost.Name = "txtHost";
            this.txtHost.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.txtHost.Size = new System.Drawing.Size(117, 20);
            this.txtHost.TabIndex = 4;
            this.txtHost.Text = "0.0.0.0";
            // 
            // cmdConnect
            // 
            this.cmdConnect.BackColor = System.Drawing.SystemColors.Control;
            this.cmdConnect.Cursor = System.Windows.Forms.Cursors.Default;
            this.cmdConnect.ForeColor = System.Drawing.SystemColors.ControlText;
            this.cmdConnect.Location = new System.Drawing.Point(320, 12);
            this.cmdConnect.Name = "cmdConnect";
            this.cmdConnect.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.cmdConnect.Size = new System.Drawing.Size(69, 23);
            this.cmdConnect.TabIndex = 0;
            this.cmdConnect.Text = "Connect";
            this.cmdConnect.UseVisualStyleBackColor = false;
            this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
            // 
            // Label17
            // 
            this.Label17.AutoSize = true;
            this.Label17.BackColor = System.Drawing.SystemColors.Control;
            this.Label17.Cursor = System.Windows.Forms.Cursors.Default;
            this.Label17.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Label17.Location = new System.Drawing.Point(20, 396);
            this.Label17.Name = "Label17";
            this.Label17.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.Label17.Size = new System.Drawing.Size(55, 13);
            this.Label17.TabIndex = 48;
            this.Label17.Text = "Event log:";
            // 
            // Line3
            // 
            this.Line3.BackColor = System.Drawing.SystemColors.AppWorkspace;
            this.Line3.Location = new System.Drawing.Point(16, 388);
            this.Line3.Name = "Line3";
            this.Line3.Size = new System.Drawing.Size(380, 1);
            this.Line3.TabIndex = 49;
            // 
            // Label16
            // 
            this.Label16.BackColor = System.Drawing.SystemColors.Control;
            this.Label16.Cursor = System.Windows.Forms.Cursors.Default;
            this.Label16.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Label16.Location = new System.Drawing.Point(20, 280);
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.Label16.Size = new System.Drawing.Size(57, 29);
            this.Label16.TabIndex = 47;
            this.Label16.Text = "User Data Header:";
            // 
            // Line2
            // 
            this.Line2.BackColor = System.Drawing.SystemColors.AppWorkspace;
            this.Line2.Location = new System.Drawing.Point(16, 164);
            this.Line2.Name = "Line2";
            this.Line2.Size = new System.Drawing.Size(380, 1);
            this.Line2.TabIndex = 50;
            // 
            // Line1
            // 
            this.Line1.BackColor = System.Drawing.SystemColors.AppWorkspace;
            this.Line1.Location = new System.Drawing.Point(16, 76);
            this.Line1.Name = "Line1";
            this.Line1.Size = new System.Drawing.Size(380, 1);
            this.Line1.TabIndex = 51;
            // 
            // Label9
            // 
            this.Label9.AutoSize = true;
            this.Label9.BackColor = System.Drawing.SystemColors.Control;
            this.Label9.Cursor = System.Windows.Forms.Cursors.Default;
            this.Label9.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Label9.Location = new System.Drawing.Point(20, 320);
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.Label9.Size = new System.Drawing.Size(55, 13);
            this.Label9.TabIndex = 46;
            this.Label9.Text = "Encoding:";
            // 
            // Label3
            // 
            this.Label3.AutoSize = true;
            this.Label3.BackColor = System.Drawing.SystemColors.Control;
            this.Label3.Cursor = System.Windows.Forms.Cursors.Default;
            this.Label3.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Label3.Location = new System.Drawing.Point(20, 180);
            this.Label3.Name = "Label3";
            this.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.Label3.Size = new System.Drawing.Size(55, 13);
            this.Label3.TabIndex = 45;
            this.Label3.Text = "Originator:";
            // 
            // Label7
            // 
            this.Label7.AutoSize = true;
            this.Label7.BackColor = System.Drawing.SystemColors.Control;
            this.Label7.Cursor = System.Windows.Forms.Cursors.Default;
            this.Label7.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Label7.Location = new System.Drawing.Point(20, 228);
            this.Label7.Name = "Label7";
            this.Label7.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.Label7.Size = new System.Drawing.Size(53, 13);
            this.Label7.TabIndex = 44;
            this.Label7.Text = "Message:";
            // 
            // Label6
            // 
            this.Label6.AutoSize = true;
            this.Label6.BackColor = System.Drawing.SystemColors.Control;
            this.Label6.Cursor = System.Windows.Forms.Cursors.Default;
            this.Label6.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Label6.Location = new System.Drawing.Point(20, 204);
            this.Label6.Name = "Label6";
            this.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.Label6.Size = new System.Drawing.Size(63, 13);
            this.Label6.TabIndex = 43;
            this.Label6.Text = "Destination:";
            // 
            // Label2
            // 
            this.Label2.AutoSize = true;
            this.Label2.BackColor = System.Drawing.SystemColors.Control;
            this.Label2.Cursor = System.Windows.Forms.Cursors.Default;
            this.Label2.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Label2.Location = new System.Drawing.Point(224, 16);
            this.Label2.Name = "Label2";
            this.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.Label2.Size = new System.Drawing.Size(29, 13);
            this.Label2.TabIndex = 42;
            this.Label2.Text = "Port:";
            // 
            // Label1
            // 
            this.Label1.AutoSize = true;
            this.Label1.BackColor = System.Drawing.SystemColors.Control;
            this.Label1.Cursor = System.Windows.Forms.Cursors.Default;
            this.Label1.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Label1.Location = new System.Drawing.Point(20, 16);
            this.Label1.Name = "Label1";
            this.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.Label1.Size = new System.Drawing.Size(80, 13);
            this.Label1.TabIndex = 40;
            this.Label1.Text = "SMSC address:";
            // 
            // chkDirectDisplay
            // 
            this.chkDirectDisplay.BackColor = System.Drawing.SystemColors.Control;
            this.chkDirectDisplay.Cursor = System.Windows.Forms.Cursors.Default;
            this.chkDirectDisplay.ForeColor = System.Drawing.SystemColors.ControlText;
            this.chkDirectDisplay.Location = new System.Drawing.Point(100, 364);
            this.chkDirectDisplay.Name = "chkDirectDisplay";
            this.chkDirectDisplay.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.chkDirectDisplay.Size = new System.Drawing.Size(201, 17);
            this.chkDirectDisplay.TabIndex = 17;
            this.chkDirectDisplay.Text = "Direct display (Flash SMS)";
            this.chkDirectDisplay.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
            this.chkDirectDisplay.UseVisualStyleBackColor = false;
            // 
            // txtPassword
            // 
            this.txtPassword.AcceptsReturn = true;
            this.txtPassword.BackColor = System.Drawing.SystemColors.Window;
            this.txtPassword.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtPassword.ForeColor = System.Drawing.SystemColors.WindowText;
            this.txtPassword.Location = new System.Drawing.Point(100, 112);
            this.txtPassword.MaxLength = 0;
            this.txtPassword.Name = "txtPassword";
            this.txtPassword.PasswordChar = '*';
            this.txtPassword.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.txtPassword.Size = new System.Drawing.Size(117, 20);
            this.txtPassword.TabIndex = 8;
            // 
            // txtNPI
            // 
            this.txtNPI.AcceptsReturn = true;
            this.txtNPI.BackColor = System.Drawing.SystemColors.Window;
            this.txtNPI.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtNPI.ForeColor = System.Drawing.SystemColors.WindowText;
            this.txtNPI.Location = new System.Drawing.Point(260, 112);
            this.txtNPI.MaxLength = 0;
            this.txtNPI.Name = "txtNPI";
            this.txtNPI.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.txtNPI.Size = new System.Drawing.Size(41, 20);
            this.txtNPI.TabIndex = 9;
            this.txtNPI.Text = "1";
            // 
            // txtTON
            // 
            this.txtTON.AcceptsReturn = true;
            this.txtTON.BackColor = System.Drawing.SystemColors.Window;
            this.txtTON.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtTON.ForeColor = System.Drawing.SystemColors.WindowText;
            this.txtTON.Location = new System.Drawing.Point(260, 88);
            this.txtTON.MaxLength = 0;
            this.txtTON.Name = "txtTON";
            this.txtTON.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.txtTON.Size = new System.Drawing.Size(41, 20);
            this.txtTON.TabIndex = 7;
            this.txtTON.Text = "1";
            // 
            // txtAccount
            // 
            this.txtAccount.AcceptsReturn = true;
            this.txtAccount.BackColor = System.Drawing.SystemColors.Window;
            this.txtAccount.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtAccount.ForeColor = System.Drawing.SystemColors.WindowText;
            this.txtAccount.Location = new System.Drawing.Point(100, 88);
            this.txtAccount.MaxLength = 0;
            this.txtAccount.Name = "txtAccount";
            this.txtAccount.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.txtAccount.Size = new System.Drawing.Size(117, 20);
            this.txtAccount.TabIndex = 6;
            // 
            // Label8
            // 
            this.Label8.AutoSize = true;
            this.Label8.BackColor = System.Drawing.SystemColors.Control;
            this.Label8.Cursor = System.Windows.Forms.Cursors.Default;
            this.Label8.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Label8.Location = new System.Drawing.Point(20, 116);
            this.Label8.Name = "Label8";
            this.Label8.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.Label8.Size = new System.Drawing.Size(56, 13);
            this.Label8.TabIndex = 83;
            this.Label8.Text = "Password:";
            // 
            // Label5
            // 
            this.Label5.AutoSize = true;
            this.Label5.BackColor = System.Drawing.SystemColors.Control;
            this.Label5.Cursor = System.Windows.Forms.Cursors.Default;
            this.Label5.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Label5.Location = new System.Drawing.Point(224, 116);
            this.Label5.Name = "Label5";
            this.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.Label5.Size = new System.Drawing.Size(28, 13);
            this.Label5.TabIndex = 82;
            this.Label5.Text = "NPI:";
            // 
            // Label4
            // 
            this.Label4.AutoSize = true;
            this.Label4.BackColor = System.Drawing.SystemColors.Control;
            this.Label4.Cursor = System.Windows.Forms.Cursors.Default;
            this.Label4.ForeColor = System.Drawing.SystemColors.ControlText;
            this.Label4.Location = new System.Drawing.Point(224, 92);
            this.Label4.Name = "Label4";
            this.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.Label4.Size = new System.Drawing.Size(33, 13);
            this.Label4.TabIndex = 81;
            this.Label4.Text = "TON:";
            // 
            // label10
            // 
            this.label10.AutoSize = true;
            this.label10.BackColor = System.Drawing.SystemColors.Control;
            this.label10.Cursor = System.Windows.Forms.Cursors.Default;
            this.label10.ForeColor = System.Drawing.SystemColors.ControlText;
            this.label10.Location = new System.Drawing.Point(20, 92);
            this.label10.Name = "label10";
            this.label10.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.label10.Size = new System.Drawing.Size(50, 13);
            this.label10.TabIndex = 80;
            this.label10.Text = "Account:";
            this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // chkUseAuthentication
            // 
            this.chkUseAuthentication.BackColor = System.Drawing.SystemColors.Control;
            this.chkUseAuthentication.Cursor = System.Windows.Forms.Cursors.Default;
            this.chkUseAuthentication.ForeColor = System.Drawing.SystemColors.ControlText;
            this.chkUseAuthentication.Location = new System.Drawing.Point(100, 136);
            this.chkUseAuthentication.Name = "chkUseAuthentication";
            this.chkUseAuthentication.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.chkUseAuthentication.Size = new System.Drawing.Size(216, 17);
            this.chkUseAuthentication.TabIndex = 10;
            this.chkUseAuthentication.Text = "Use Authentication (OT-60 operation)";
            this.chkUseAuthentication.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
            this.chkUseAuthentication.UseVisualStyleBackColor = false;
            // 
            // SMSCclientUCP
            // 
            this.SMSCclientUCP.ImmediateResponse = false;
            this.SMSCclientUCP.KeepAliveInterval = 10;
            this.SMSCclientUCP.KeepAliveOperation = smscc.UCP.ucpKeepAliveOperationEnum.aoSMTAlert;
            this.SMSCclientUCP.ResponseTimeOut = 10;
            this.SMSCclientUCP.ThrottleRate = 0;
            this.SMSCclientUCP.OnUcpStatusReportReceived += new smscc.UCP.ucpStatusReportReceivedEvent(this.SMSCclientUCP_OnUcpStatusReportReceived);
            this.SMSCclientUCP.OnTcpDisconnected += new smscc.tcpDisconnectedEvent(this.SMSCclientUCP_OnTcpDisconnected);
            this.SMSCclientUCP.OnUcpMessageReceived += new smscc.UCP.ucpMessageReceivedEvent(this.SMSCclientUCP_OnUcpMessageReceived);
            // 
            // fmMain
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(414, 535);
            this.Controls.Add(this.chkUseAuthentication);
            this.Controls.Add(this.txtPassword);
            this.Controls.Add(this.txtNPI);
            this.Controls.Add(this.txtTON);
            this.Controls.Add(this.txtAccount);
            this.Controls.Add(this.Label8);
            this.Controls.Add(this.Label5);
            this.Controls.Add(this.Label4);
            this.Controls.Add(this.label10);
            this.Controls.Add(this.chkStatusReport);
            this.Controls.Add(this.txtUDH);
            this.Controls.Add(this.cbEncoding);
            this.Controls.Add(this.txtOriginator);
            this.Controls.Add(this.cmdInitialize);
            this.Controls.Add(this.txtDestination);
            this.Controls.Add(this.txtLog);
            this.Controls.Add(this.cmdSubmit);
            this.Controls.Add(this.txtSubmit);
            this.Controls.Add(this.cmdDisconnect);
            this.Controls.Add(this.txtPort);
            this.Controls.Add(this.txtHost);
            this.Controls.Add(this.cmdConnect);
            this.Controls.Add(this.Label17);
            this.Controls.Add(this.Line3);
            this.Controls.Add(this.Label16);
            this.Controls.Add(this.Line2);
            this.Controls.Add(this.Line1);
            this.Controls.Add(this.Label9);
            this.Controls.Add(this.Label3);
            this.Controls.Add(this.Label7);
            this.Controls.Add(this.Label6);
            this.Controls.Add(this.Label2);
            this.Controls.Add(this.Label1);
            this.Controls.Add(this.chkDirectDisplay);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "fmMain";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "SMSC client .NET UCP sample";
            this.Load += new System.EventHandler(this.fmMain_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

		}
		#endregion

		private EventLog Log;

		[STAThread]

		static void Main() 
		{
			Application.Run(new fmMain());
		}

		// Connect to SMSC
		private void cmdConnect_Click(object sender, System.EventArgs e)
		{
			int Result;

			txtLog.Text = "";
			txtLog.Refresh();

			Result = SMSCclientUCP.tcpConnect(txtHost.Text, int.Parse(txtPort.Text), "");

			if(Result != 0)
				Log.AddConnectionErrorEvent(Result);
			else
				Log.AddConnectedEvent();
		}

		// Disonnect from SMSC
		private void cmdDisconnect_Click(object sender, System.EventArgs e)
		{
			SMSCclientUCP.tcpDisconnect();
		}

		private void cmdInitialize_Click(object sender, System.EventArgs e)
		{
			int Result;

			Result = SMSCclientUCP.ucpInitializeSession(txtAccount.Text, byte.Parse(txtTON.Text), byte.Parse(txtNPI.Text), txtPassword.Text, chkUseAuthentication.Checked, "");

			if(Result != 0)
				Log.AddInitializationErrorEvent(Result);
			else
				Log.AddInitializedEvent();
		}

		// Submit message to the SMSC
		private void cmdSubmit_Click(object sender, System.EventArgs e)
		{
			int Result;
			String SystemMessage;
			DateTime TimeStamp;
			EncodingEnum Encoding;
			int Options;

			switch(cbEncoding.SelectedIndex)
			{
				case 2:
					Encoding = EncodingEnum.etUCS2Text;
					break;
				case 1:
					Encoding = EncodingEnum.et8BitHexadecimal;
					break;
				default:
					Encoding = EncodingEnum.et7BitText;
					break;
			}
			
			Options = 0;
			if(chkStatusReport.CheckState == CheckState.Checked)
				Options |= (int)SubmitOptionEnum.soRequestStatusReport;
			if(chkDirectDisplay.CheckState == CheckState.Checked)
				Options |= (int)SubmitOptionEnum.soDirectDisplay;
			
			Result = SMSCclientUCP.ucpSubmitMessage(txtDestination.Text, txtOriginator.Text, txtSubmit.Text, Encoding, txtUDH.Text, Options, out SystemMessage, out TimeStamp);
			
			if(Result != 0)
				Log.AddMessageSubmissionErrorEvent(Result);
			else
				Log.AddMessageSubmitedEvent(TimeStamp);
		}

		private void fmMain_Load(object sender, System.EventArgs e)
		{
			Log = new EventLog(txtLog);		
			cbEncoding.SelectedIndex = 0;
		}

		// Disconnected from SMSC
		private void SMSCclientUCP_OnTcpDisconnected(object sender, tcpDisconnectedEventArgs e)
		{
			Log.AddDisconnectedEvent(e.Reason);
		}

		// Message received from SMSC
		private void SMSCclientUCP_OnUcpMessageReceived(object Sender, ucpMessageReceivedEventArgs e)
		{
			Log.AddMessageReceivedEvent(e.Destination, e.Originator, e.Content, e.Encoding, e.UserDataHeader, e.TimeStamp);
		}

		// Status Report (SR) received from SMSC
		private void SMSCclientUCP_OnUcpStatusReportReceived(object Sender, ucpStatusReportReceivedEventArgs e)
		{
			Log.AddStatusReportReceivedEvent(e.MessageTimeStamp, e.Destination, e.Originator, e.DeliveryStatus, e.ReasonCode, e.TimeStamp);
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit